I'm using an ajax call to call a php script which waits 40 seconds via sleep and then outputs RELOAD
. In JavaScript, the output is checked to be RELOAD
, and if so, the call starts again.
This works quite fine on every page I use this. But in Firefox, there is one problem in a specific case.
I am on this page which does those calls, then I click on a link to get to another page. After that, I go back via clicking on the History (Back-)Button. In this case, the calls do start, but firefox seems to have cached the result and immediately outputs RELOAD
. This results in calls which take only a few milliseconds to load and i do not get any actualized content. It does not even connect to the server (I changed the php file while the ajax calls kept on going but it took no effect).
So Firefox seems to use cached output ONLY in the case you use the back button (or also javascript:history.back()
). If I load the page normal (via link or entering the url in the address bar), the calls do get correctly to the server and get the actual content.
Is there a way I can overwrite this behaviour from PHP or JavaScript? I am using jQuery.ajax()
and I have set the "cache:false
"-option.
Thank you for your help!