AJAX Gotcha Browser caching

Problem

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.



Solution

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.



Example


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



Reference

[tags][/tags]



Leave a Reply

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