I'm running into a strange problem on my webpage using the jQuery $.get
function. The code below is executed on page load:
$.get(urls.validateSession, function(data){
console.log(data);
});
I would expect this to make a GET request to urls.validateSession
each time the page is loaded, then log the response data to the console.
It does this on the initial page load with no problems. But on subsequent page loads, jQuery does not make a new request to urls.validateSession
. It instead just prints the exact same response data from the previous request (identical response timestamp and everything!)
Interestingly, when reloading the page with Shift + F5
, jQuery does make a new request to urls.validateSession
and I can see a new response timestamp.
Can anyone explain this behavior?