0

I am running a JavaScript and AJAX based chatroom. When a user leaves the page and then returns by using the Back button, they load the page from the cache. The JavaScript has to hurry and get the page back up to date, as it sees the last refresh was long ago and and requests a huge length of time in chat history to fill the gap.

What I would like instead is for the browser to be explicitly told that that HTML is invalid once they leave the page and they should do a straight refresh instead if they return to it.

Josh
  • 3,258
  • 2
  • 19
  • 31
  • 1
    "***they load the page from the cache***" http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers – Pedro Lobito May 02 '16 at 13:52
  • @PedroLobito Perfect! Sorry for the dupe, you're a better googler than I am apparently. – Josh May 02 '16 at 13:54
  • "*you're a better googler*" You know this site has a search engine too, right? Funny how people run to Google (from SO), perform a search, only to have SO be the top 10 results and you find your way back here anyway. Why not just use the search bar at the top of the page? lol – mferly May 02 '16 at 13:56
  • 1
    @Marcus Google search algorithm is way better than SO – Pedro Lobito May 02 '16 at 14:32

1 Answers1

0

You can try to use the HTML5 Application Cache Manifest.

See w3schools. Link to an Chache Manifest and specifie that nothing should be cached (NETWORK:*).

<!DOCTYPE HTML>
<html manifest="demo.appcache">
...
</html> 

demo.appcache:

CACHE MANIFEST
CHACHE:
NETWORK:
*
FALLBACK:
d4rty
  • 3,970
  • 5
  • 34
  • 73