Re: [Resin-interest] GzipFilter Overrides Cache-Control
Hi Tyson, What's version of resin is this on? thanks Alex Not sure this is a bug with GzipFilter or expected behavior, but found something worth sharing and dropping in the forum record for others to find. We had a problem distributing content to a CDN and keeping it in cache there because the CDN was requesting content with an Accept-Encoding: gzip request header, which was causing our GzipFilter to slap a Cache-Control: private response header via the http response object. Our file servlet (an extension of the default resin file servlet) was adding a Cache-Control header with max-age=84, public that the GzipFilter ended up writing Cache-Control: max-age=84000, public, private. In our testing, we were using curl to test/examine the headers, so we didn't pick up that the private cache control header was being added. Our CDN provider, however, was testing with a user agent that indicated it accepted the gzip encoding and was thus seeing the cache-control header appear. Made for a lively debate. Thus, they were seeing the private declaration and not caching the result. So, we had to add an exclude-pattern to our GzipFilter configuration to not pick up files in the directory we wanted to control caching on. So, fyi, either GzipFilter has a bug in that it is not honoring Cache-Control headers set by responses further downstream, or it is operating properly and you must remember to disable the GzipFilter on content you want to be cached publicly. It would be nice if GzipFilter honored cache-control directives. configuration e.g.: filter-mapping filter-namegzip/filter-name url-pattern exclude-pattern*.zip/exclude-pattern include-pattern/*/include-pattern /url-pattern /filter-mapping -tyson -- View this message in context: http://old.nabble.com/GzipFilter-Overrides-Cache-Control-tp27022353p27022353.html Sent from the Resin mailing list archive at Nabble.com. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] GzipFilter Overrides Cache-Control
Resin Pro 3.1.9 -tyson On Tue, Jan 5, 2010 at 2:44 PM, Alex a...@caucho.com wrote: Hi Tyson, What's version of resin is this on? thanks Alex Not sure this is a bug with GzipFilter or expected behavior, but found something worth sharing and dropping in the forum record for others to find. We had a problem distributing content to a CDN and keeping it in cache there because the CDN was requesting content with an Accept-Encoding: gzip request header, which was causing our GzipFilter to slap a Cache-Control: private response header via the http response object. Our file servlet (an extension of the default resin file servlet) was adding a Cache-Control header with max-age=84, public that the GzipFilter ended up writing Cache-Control: max-age=84000, public, private. In our testing, we were using curl to test/examine the headers, so we didn't pick up that the private cache control header was being added. Our CDN provider, however, was testing with a user agent that indicated it accepted the gzip encoding and was thus seeing the cache-control header appear. Made for a lively debate. Thus, they were seeing the private declaration and not caching the result. So, we had to add an exclude-pattern to our GzipFilter configuration to not pick up files in the directory we wanted to control caching on. So, fyi, either GzipFilter has a bug in that it is not honoring Cache-Control headers set by responses further downstream, or it is operating properly and you must remember to disable the GzipFilter on content you want to be cached publicly. It would be nice if GzipFilter honored cache-control directives. configuration e.g.: filter-mapping filter-namegzip/filter-name url-pattern exclude-pattern*.zip/exclude-pattern include-pattern/*/include-pattern /url-pattern /filter-mapping -tyson -- View this message in context: http://old.nabble.com/GzipFilter-Overrides-Cache-Control-tp27022353p27022353.html Sent from the Resin mailing list archive at Nabble.com. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] GzipFilter Overrides Cache-Control
Not sure this is a bug with GzipFilter or expected behavior, but found something worth sharing and dropping in the forum record for others to find. We had a problem distributing content to a CDN and keeping it in cache there because the CDN was requesting content with an Accept-Encoding: gzip request header, which was causing our GzipFilter to slap a Cache-Control: private response header via the http response object. Our file servlet (an extension of the default resin file servlet) was adding a Cache-Control header with max-age=84, public that the GzipFilter ended up writing Cache-Control: max-age=84000, public, private. In our testing, we were using curl to test/examine the headers, so we didn't pick up that the private cache control header was being added. Our CDN provider, however, was testing with a user agent that indicated it accepted the gzip encoding and was thus seeing the cache-control header appear. Made for a lively debate. Thus, they were seeing the private declaration and not caching the result. So, we had to add an exclude-pattern to our GzipFilter configuration to not pick up files in the directory we wanted to control caching on. So, fyi, either GzipFilter has a bug in that it is not honoring Cache-Control headers set by responses further downstream, or it is operating properly and you must remember to disable the GzipFilter on content you want to be cached publicly. It would be nice if GzipFilter honored cache-control directives. configuration e.g.: filter-mapping filter-namegzip/filter-name url-pattern exclude-pattern*.zip/exclude-pattern include-pattern/*/include-pattern /url-pattern /filter-mapping The private cache-control is added by Resin Cache in this case(not gzip filter ) following the value set in resin.conf cacherewrite-vary-as-private. It has to do with the IE bug (outlined in more detail at : http://www.caucho.com/resin/doc/cluster-tags.xtp#rewrite-vary-as-private ) -Alex -tyson -- View this message in context: http://old.nabble.com/GzipFilter-Overrides-Cache-Control-tp27022353p27022353.html Sent from the Resin mailing list archive at Nabble.com. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] GzipFilter Overrides Cache-Control
Not sure this is a bug with GzipFilter or expected behavior, but found something worth sharing and dropping in the forum record for others to find. We had a problem distributing content to a CDN and keeping it in cache there because the CDN was requesting content with an Accept-Encoding: gzip request header, which was causing our GzipFilter to slap a Cache-Control: private response header via the http response object. Our file servlet (an extension of the default resin file servlet) was adding a Cache-Control header with max-age=84, public that the GzipFilter ended up writing Cache-Control: max-age=84000, public, private. In our testing, we were using curl to test/examine the headers, so we didn't pick up that the private cache control header was being added. Our CDN provider, however, was testing with a user agent that indicated it accepted the gzip encoding and was thus seeing the cache-control header appear. Made for a lively debate. Thus, they were seeing the private declaration and not caching the result. So, we had to add an exclude-pattern to our GzipFilter configuration to not pick up files in the directory we wanted to control caching on. So, fyi, either GzipFilter has a bug in that it is not honoring Cache-Control headers set by responses further downstream, or it is operating properly and you must remember to disable the GzipFilter on content you want to be cached publicly. It would be nice if GzipFilter honored cache-control directives. configuration e.g.: filter-mapping filter-namegzip/filter-name url-pattern exclude-pattern*.zip/exclude-pattern include-pattern/*/include-pattern /url-pattern /filter-mapping -tyson -- View this message in context: http://old.nabble.com/GzipFilter-Overrides-Cache-Control-tp27022353p27022353.html Sent from the Resin mailing list archive at Nabble.com. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest