Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Pagespeed strips Cache-Control:no-store, etc. headers #683

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 8 comments
Closed

Pagespeed strips Cache-Control:no-store, etc. headers #683

GoogleCodeExporter opened this issue Apr 6, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

From nathan@k...:

We're seeing an issue where Chrome visitors see a (locally) cached version of 
the page when they use their "Back" button.  This shouldn't be happening -- the 
page should always be reloaded from the server.

I've narrowed the cause down to mod-pagespeed's treatment of the cache headers 
(i.e. everything works correctly when mod-pagespeed is disabled).  I understand 
there's a config option to prevent mod-pagespeed modifying cache headers, but 
the fact that the rest of the world isn't seeing this problem with 
mod-pagespeed/Chrome makes me think I'm doing something wrong. 

What's the best practice for preventing Chrome from serving a cached page on 
"back" (when using mod-pagespeed)?  For example, one solution is to add a 
cache-control header of 'no-store', but the header stripped by mod-pagespeed.

HEADERS BEFORE MOD_PAGESPEED (page is always reloaded from server)
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Length:26110
Content-Type:text/html;charset=utf-8
Date:Wed, 24 Apr 2013 19:35:22 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:Apache

HEADERS AFTER MOD_PAGESPEED (page is not reloaded when user goes "back")
Cache-Control:max-age=0, no-cache
Connection:keep-alive
Content-Length:26396
Content-Type:text/html;charset=utf-8
Date:Wed, 24 Apr 2013 19:34:29 GMT
Pragma:no-cache
Server:Apache
Vary:Accept-Encoding
X-Mod-Pagespeed:1.2.24.1-2581

Original issue reported on code.google.com by sligocki@google.com on 24 Apr 2013 at 8:26

@GoogleCodeExporter
Copy link
Author

mod_pagespeed should change its default header-mutation algorithm to only make 
cache-control *more* conservative and never *less* conservative.

Original comment by jmara...@google.com on 24 Apr 2013 at 8:33

@GoogleCodeExporter
Copy link
Author

Issue 730 has been merged into this issue.

Original comment by jmara...@google.com on 25 Jun 2013 at 1:59

@GoogleCodeExporter
Copy link
Author

Original comment by jmara...@google.com on 25 Jun 2013 at 1:59

@GoogleCodeExporter
Copy link
Author

Original comment by jmara...@google.com on 25 Jun 2013 at 4:33

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Fixed in https://code.google.com/p/modpagespeed/source/detail?r=3208

Original comment by jmara...@google.com on 25 Jun 2013 at 4:33

  • Added labels: Milestone-v29, release-note

@GoogleCodeExporter
Copy link
Author

What gets stripped should definitely be configurable. I have seen issues with 
the header changes in my travels.

May I suggest a config directive like ModPagespeedPassHeaders which has a 
hardcoded default to whatever you feel optimal, but still allow the application 
developers to have ultimate control.

Original comment by l...@aura.travel on 2 Jul 2013 at 9:47

@GoogleCodeExporter
Copy link
Author

Interesting enough, the headers do not currently get stripped from dynamically 
generated images - ie. ETag, Last-modified, etc get passed through.

Original comment by l...@aura.travel on 2 Jul 2013 at 9:51

@GoogleCodeExporter
Copy link
Author

Original comment by jkar...@google.com on 6 Aug 2013 at 6:35

  • Changed title: Pagespeed strips Cache-Control:no-store, etc. headers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant