I am working on a Django 1.3.1 website which is highly dynamic by nature. On many pages certain elements have to be refreshed each 10-20 seconds. We use AJAX requests for this.
Now, on the backend side each AJAX is handled by executing a DB query or possibly from cache (I expect 95% times it’s going to be from cache). We are thinking to change the method to instead put the updates to some files served by the web server. Then instead of hitting Django, AJAX would be handled by just serving the file. Backend would take care of updating the files if it’s necessary (those files are very small; a couple of numbers).
Have anyone tried something like this? What possible drawbacks can you see (arising for instance from concurrent read/write file access)? Is it likely to gain some performance from this approach?
Why do you want to put frequently used data from DB to static file.If you want to render it fast take a look at MEMCAHED…I think this will satisfy you. Link below:
MEMCAHCED