oschaaf commented on issue #1535: ModifyCachingHeaders should only apply to html responses URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1535#issuecomment-365173878 Not sure if this works for cache directives but it is worth a try.. Could you try if you can use https://www.modpagespeed.com/doc/configuration#add-resource-header to massage the final resource response headers into what you need? Otto On Tue, 13 Feb 2018 at 07:54, Tobias Schlottke <notificati...@github.com> wrote: > Hi Otto, > > I have got this configuration set up for caching of .pagespeed. resources: > > # Ensure requests for pagespeed optimized resources go to the pagespeed handler > # and no extraneous headers get set. > location ~ "\.pagespeed\." { > add_header "Cache-Control: public, max-age=86400"; > } > > If I disable pagespeed, there are no .pagespeed. resources but if I use > the same config for all static resources, it obviously works. > > I now played with both, ModifyCachingHeaders and extend_cache with the > following results: > > *pagespeed ModifyCachingHeaders Off, pagespeed EnableFilters extend_cache:* > > HTTP/1.1 200 OK > Date: Tue, 13 Feb 2018 06:31:29 GMT > Content-Type: text/css > Connection: keep-alive > Server: nginx > Accept-Ranges: bytes > X-Original-Content-Length: 32893 > Vary: Accept-Encoding > Content-Length: 25405 > X-Page-Speed: 1.12.34.3-0 > > *pagespeed ModifyCachingHeaders On, pagespeed EnableFilters extend_cache:* > > HTTP/1.1 200 OK > Content-Type: text/css > Connection: keep-alive > Server: nginx > Accept-Ranges: bytes > Date: Thu, 08 Feb 2018 22:06:44 GMT > Expires: Fri, 08 Feb 2019 22:06:44 GMT > ETag: W/"0" > Last-Modified: Thu, 08 Feb 2018 22:06:44 GMT > Cache-Control: max-age=31536000, public > X-Original-Content-Length: 32893 > Vary: Accept-Encoding > Content-Length: 25405 > X-Page-Speed: 1.12.34.3- > > Disabling extend_cache has the same result as the first example. > > Conclusion: ModifyCachingHeaders On and extend_cache in combination are > closest to the expected result. > I cannot turn ModifyCachingHeaders to On as caching HTML won't work > anymore. I also can't modify the headers manually as pagespeed suppresses > this. > Also, the ETag: W/"0" will lead to minus points when checking with > Pagespeed insights. > > What can I do? Why can't I override caching for those resources, if I need > to? > > Tobias > > ? > You are receiving this because you were mentioned. > > > Reply to this email directly, view it on GitHub > <https://github.com/apache/incubator-pagespeed-ngx/issues/1535#issuecomment-365168160>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ACIsRNqOBG-lvmeNkQx5q4lxYBQSp6Osks5tUTGjgaJpZM4R-HVL> > . >
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services