PHP Ajax Caching for IE7 and iE8
I have an application written in PHP / Javascript that uses AJAX extensively. I am concerned that the default IE7 and IE8 caching behavior set for our organization to "Automatic" will cause my application to crash.
There are about 1500 users and my IT department says they will not change the caching setting in IE for all of these users.
My question is, how can I absolutely ensure that if I make changes to my application, all users will see the change immediately?
Also, how can I ensure that the AJAX always produces fresh results? Do I have to resort to making all my urls unique for every call?
Apparently, there is a certain amount of uncertainty in this topic on the Internet. There should be a definitive answer that always works.
Additional questions
Why doesn't just setting the HTTP headers in the AJAX files do the trick?
Also, how do I know if these solutions actually work? What is the correct procedure for testing caching behavior?
source to share
generating a unique URL is not a significant overhead. You just need to add a random number to the end of the url. In the case of GET requests, you can do it like this:
/someresource.php?some_key=foo&no_cache=9832742938642
You can simply ignore the rand key value pair in all script handling the request.
As far as I know, this is the only option you have.
source to share
Use a POST request instead, as the data on the server is obviously changing (otherwise you wouldn't have a caching problem). See http://javascript.about.com/od/ajax/a/ajaxgp.htm
source to share