While testing django cashing on our development server, one of our senior asked if is it possible to change the value of caching timeout on
urls.py without restarting the http service.
On first note, I was 100% sure it can be done by changing the timeout value dynamically.
For example - As suggested by my other colleague, If we save the timeout value in separate xml file and read this file value in urls.py and assign that value on the caching command, then by changing the value in the xml file, caching timeout will be updated without restarting the http service.
But when we tested this, we came to an understanding that it works only on first hit as the
urlpattern object is passed to django server and
urls.py never runs again unless the http service is restarted.
In the end to get our requirement done, we had to write few more script inside the view function to load the urls.py again so that it reads the new caching timeout value.
So my question is why this urls.py is not loaded every time on every url hit but only once on first time?, where does this urlpattern object goes?, Any Idea!