Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

z3c.hashedresource and cache response headers

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


janwijbrand at gmail

Sep 18, 2009, 8:06 AM

Post #1 of 4 (661 views)
Permalink
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

_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


srichter at cosmos

Sep 18, 2009, 8:08 AM

Post #2 of 4 (630 views)
Permalink
Re: z3c.hashedresource and cache response headers [In reply to]

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"
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


janwijbrand at gmail

Sep 18, 2009, 8:34 AM

Post #3 of 4 (620 views)
Permalink
Re: z3c.hashedresource and cache response headers [In reply to]

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

_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


srichter at cosmos

Sep 18, 2009, 9:49 AM

Post #4 of 4 (612 views)
Permalink
Re: z3c.hashedresource and cache response headers [In reply to]

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"
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.