user3364552
user3364552

Reputation:

Google Chrome is not caching web page

My web app's pages don't seem to be cached (bfcache) in google chrome. It works well with firefox and even with qupzilla.

I wanted the pages to be left as is when the user opens a link and back but this doesn't seem to work with chrome. When I press the back button it reloads the page, $(document).ready() is called.

Google Chrome: Version 46.0.2490.71 (64-bit)

Response Headers
view source
Content-Type:text/html; charset=utf-8
Date:Fri, 23 Oct 2015 03:48:59 GMT
Server:WSGIServer/0.1 Python/2.7.6
X-Frame-Options:SAMEORIGIN

Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:localhost:8000
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36

Upvotes: 1

Views: 1175

Answers (1)

moodboom
moodboom

Reputation: 6902

It seems that all these decisions about refreshing the cache are not standard across browsers and even prone to change on the whims of the maker of the browser. My latest testing is showing some consistency finally:

  • USE CACHE (chrome/ff): follow a link from another page
  • USE CACHE (chrome/ff): use history or forward/back buttons
  • USE CACHE (chrome/ff): press enter on url in address bar
  • USE CACHE (ff): go into dev tools, remove Cache-Control from request header, resubmit
  • BYPASS CACHE (chrome/ff): refresh button in toolbar
  • BYPASS CACHE (chrome/ff): F5 (but still uses ETag)
  • BYPASS CACHE (chrome/ff): [ctrl|cmd]-F5 (ignores ETag)
  • BYPASS CACHE (chrome/ff): enable dev tools "bypass cache" checkbox

Upvotes: 0

Related Questions