Pagespeed - Cache-Control responses that will be optimised

14 views
Skip to first unread message

Matthew Johnson

unread,
Apr 21, 2015, 11:23:07 PM4/21/15
to ngx-pagesp...@googlegroups.com


I have just hit a use case where a site is responding with "Cache-Control:max-age=1209600" for CSS and JS resources.

PageSpeed wont optimise these resources until I alter the response header to be "Cache-Control:public, max-age=1209600"

I cant see where the RFC says resources without a specific directive should not be cached (/optimised) - http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4

Am I reading things wrong or is there an issue with my sample response headers?

Matt


Jeff Kaufman

unread,
Apr 22, 2015, 7:39:57 AM4/22/15
to ngx-pagesp...@googlegroups.com
PageSpeed shouldn't be requiring public in Cache-Control. For example:

$ curl -D- www.jefftk.com/cc-no-public/example.js?$RANDOM
HTTP/1.1 200 OK
Server: nginx/1.7.5
Content-Type: application/javascript
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Date: Wed, 22 Apr 2015 11:38:22 GMT
Expires: Wed, 22 Apr 2015 11:43:22 GMT
Cache-Control: max-age=300
Last-Modified: Wed, 22 Apr 2015 11:37:20 GMT

document.write("hello world");

$ curl -D- www.jefftk.com/cc-no-public/example?PageSpeedFilters=rewrite_javascript
HTTP/1.1 200 OK
Server: nginx/1.7.5
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Date: Wed, 22 Apr 2015 11:39:54 GMT
X-Page-Speed: 1.9.32.1-4238
Cache-Control: max-age=0, no-cache

<script src="example.js.pagespeed.jm.FMcWf6kM9U.js"></script>
> --
> You received this message because you are subscribed to the Google Groups
> "ngx-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ngx-pagespeed-di...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ngx-pagespeed-discuss.
> For more options, visit https://groups.google.com/d/optout.

Jeff Kaufman

unread,
Apr 22, 2015, 7:40:31 AM4/22/15
to ngx-pagesp...@googlegroups.com
Could you share a link to your site, or is there anything unusual
about your setup?

Matthew Johnson

unread,
Apr 22, 2015, 8:39:48 AM4/22/15
to ngx-pagesp...@googlegroups.com
Hi Jeff,

Cheers for quick response, Ill pull together an example on my end and provide details.

Cant think of anything too unusual in this setup.

Update for you tomorrow,
Matt
Reply all
Reply to author
Forward
0 new messages