AJAX Gotcha Browser caching


Spent many hours debug my code on elizaclaire.darlingranges.com.

I kept wondering why, whenever I updated the code – it did not get reflect through.



Eventually but printing the date within the sub request, I found the browser was caching the sub request!

The fix was very easy, to force a header under apache – turning off caching.



Header set cache-control "no-cache"
Header set Pragma "no-cache"
Header set Expires "-1"





If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

Your email address will not be published. Required fields are marked *