http://alphahydrae.com/2013/03/conditional-get-with-rails/
when we have an ajax request in jquery with cache set to false, it appends a timestamp as a param to the end of the url
e.g.
$ .ajax ({
url: "http://example.com/",
cache: false,
data: {
a: "abcd"
},
...
});
http://example.com/?a=abcd& _ = 1253861397368
if you set cache to be true, it will remove the timestamp:
$ .ajax ({
url: "http://example.com/",
cache: true, // URL at the end of the time stamp is not needed
param: {
a: "abcd"
},
beforeSend: function (xhr) {
xhr.setRequestHeader ( "If-Modified-Since ", "Thu, 01 Jun 1970 00:00:00 GMT");
},
...
});