How can we deal with “checking for new versions of a page”?
I have a web app. that uses AJAX (via jQuery). I noticed that some users make updates that should automatically update on the web page via $.get, but in some cases no update occurs. I narrowed the problem down to either
A. A race condition or B. Caching
I am unable to reproduce the problem on my browsers, IE7 and FF7. I went to the user's machine and had them check the setting to "Check for new versions of a page: Every visit" in IE7. The problem seems to be gone. So, I am confident the problem is this setting, originally set to "Automatic".
Do other browsers support this "caching" (or however this technically translates)?
Any idea why IE7 is not smart enough to let AJAX $.get() requests not be cached when code explicitly makes a server call? I mean, is there a known bug or is this a "feature"?
Can it be disabled without flipping a client setting?
I guess I should move from comments to an answer.
The way to get JQuery to disable caching for you is covered by this stack overflow question.
Yes other browsers cache, I don't know of any common browser that doesn't support caching. There is some variation in how users set their preferences for this, though.
I believe the caching should be considered a feature, because it's just making a get request, though I honestly don't know if standards address this behavior.
It can't be disabled without flipping a client setting, but the easiest way around it is to make sure it doesn't see the same URL twice, so it can't possibly cache it. This is actually what JQuery does internally anyway if you set the cache parameter to false.
You can control caching via headers, but I don't think all browsers support this properly. I believe right now never repeating a URL is the only reliable cross browser solution.