Ajax cache control
- by Brian
Hello,
I am having a problem with ajax requests in Internet Explorer and in Chrome - I cannot bust the cache. Normal pages don't have the problem - it's just the ajax requests.
I know that one workaround is to append a random query string variable to the end of the URL. However, I don't want to lose all the benefits of caching, I just want the browser to pick up the new file if the version on the server is different from the cached version.
I have tried manually setting the ajax POST header, to no avail:
xmlHttp.setRequestHeader("Cache-Control", "must-revalidate");
Adding this to my .htaccess file doesn't work either:
<FilesMatch "\.(js|css).*"
Header set Cache-Control: "max-age=172800, public, must-revalidate"
</FilesMatch
Any help would be greatly appreciated.
Thanks, Brian