Code: If modified since

Chapter 8 - Ajax Optimization

Another way to prevent caching is use the XHR object’s method, setRequestHeader( ), to set the If-Modified-Since in a request to a date far in the past so that the request will appear to need to be refetched:

xhr.setRequestHeader("If-Modified-Since", "Tue, 14 Nov 1995 03:33:08 GMT");

Developers tend to prefer this method because it does not rely on changing the URI and you can do it without any server-side modifications. There is one problem with these suggestions, however. They do not optimize Ajax in any way other than making it work. We should want to use the browser cache!