New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
1 participant
@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Issue 730 has been merged into this issue.

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

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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 join this conversation on GitHub. Already have an account? Sign in to comment