z3c.hashedresource and cache response headers
Hi, We're trying to make an integration of z3c.hashedresource into Grok. While working on it we wondered how and where people using z3c.hashedresource set the caching headers for the resources referenced by the URLs generated by z3c.hashedresource. A few random thoughts about this: * zope.browserresource.file.FileResource will set cache response headers that are more or less hardcoded. Do people just use these values? * You probably only want to set "aggressive" cache response headers for resources that are referred to by the URLs generated by z3c.hashedresource. Maybe it is an idea to set these headers in the ++noop++ namespace handler? (although the name "noop" really isn't suitable anymore then - maybe it could be "++cache++" or something). Any ideas about this? regards, jw
On Friday 18 September 2009, Jan-Wijbrand Kolman wrote:
While working on it we wondered how and where people using z3c.hashedresource set the caching headers for the resources referenced by the URLs generated by z3c.hashedresource.
I think I solved that in z3c.versionedresource. Regards, Stephan -- Entrepreneur and Software Geek Google me. "Zope Stephan Richter"
Hi Stephan, Stephan Richter wrote:
On Friday 18 September 2009, Jan-Wijbrand Kolman wrote:
While working on it we wondered how and where people using z3c.hashedresource set the caching headers for the resources referenced by the URLs generated by z3c.hashedresource.
I think I solved that in z3c.versionedresource.
/me looks If I understand it correctly, you solved the cache response header issue by subclassing the resource and resource factory implementations of zope.app.publisher.browser. I guess setting cache response headers for resources could actually be factored out of the resource implementation. z3c.versionedresource could then make use of that as well. Hmmm, there's actually an older package called z3c.responseheader that does something in that direction - it wouldn't work for resources though as they set the cache headers themselves in the GET() and HEAD() methods. Would it be a good idea to remove setting the cache headers from the zope.app.publisher.browser resource implementations and make that more pluggable? z3c.versionedresource could then probably get rid of the resource subclasses, right? If people think this is a good idea, I could have a look into it.. regards, jw
On Friday 18 September 2009, Jan-Wijbrand Kolman wrote:
Would it be a good idea to remove setting the cache headers from the zope.app.publisher.browser resource implementations and make that more pluggable? z3c.versionedresource could then probably get rid of the resource subclasses, right?
Right, I probably sub-classed because there was no other way. I would welcome a hook of any kind. It seems silly to me that we cannot easily adjust such fundamental settings. Regards, Stephan -- Entrepreneur and Software Geek Google me. "Zope Stephan Richter"
participants (2)
-
Jan-Wijbrand Kolman -
Stephan Richter