HTTP Techniques

From Elvanör's Technical Wiki
Revision as of 11:54, 31 August 2007 by Elvanor (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Cache-control

  • Under Firefox, when you press the back button, Firefox does not refetch the page from the server and it does not even retrieve it from cache. It retrieves it from RAM. This can cause problems when you want to refresh the pages (typically, if some information has been added to the HTTP session for example).
  • Even if the JavaScript code makes an AJAX call this call too will be cached.
  • The solution is to use (in the HTTP headers) the Cache-Control directive with argument: no-store. Not that no-cache will *not* be enough!
  • Another solution would be (untested) to generate a unique key in an Ajax call, thus forcing the browser to actually make the call.