Cherrypy and coping with Internet Exporer Cache issues

Ahh, IE caches Ajax requests. This is rather confusing when you call a function and expect it to execute something on the server but instead it immediately returns. Luckily, it’s very simple to fix when using cherrypy. Just add the following code to your .conf file for the functions you don’t want to cache, or apply it globally.

tools.response_headers.on = True
tools.response_headers.headers = [('Expires', 'Sun, 19 Nov 1985 05:00:00 GMT'),
('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'),
('Pragma', 'no-cache')]


0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.