tobsch commented on issue #1535: Pagespeed with downstream cache: How to cache 
static resources?
URL: 
https://github.com/apache/incubator-pagespeed-ngx/issues/1535#issuecomment-365168160
 
 
   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 
(A case which @igrigorik states in his great design doc: 
https://github.com/apache/incubator-pagespeed-mod/wiki/Design-Doc:-HTML-Caching-plus-PageSpeed)
 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
   
   
   
   
   
   

----------------------------------------------------------------
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

Reply via email to