[Zope] image caching

kosh@aesaeion.com kosh@aesaeion.com
Sun, 20 May 2001 10:42:37 +0000 (UTC)


Here is the solution I came up with that does exactly what I needed.

def __bobo_traverse__(self, REQUEST, name):
	"traverse method"
	if name:
		if hasattr(self,name):
			various set header stuff
			return getattr(self,name)

Designing the webpages of tomorrow http://webme-eng.com
Designing the MMORPGS of tomorrow http://worldforge.org

On Sun, 20 May 2001, Tino Wildenhain wrote:

> Hi kosh,
>
> you should either override the index_html method of the
> image class or use the optional argument "precondition" on the
> image constructor to register a method which gets called
> every time a image (or a file) is published.
> This way you can set headers and such.
>
> HTH
> Tino Wildenhain
>
> --On Samstag, 19. Mai 2001 20:07 +0000 kosh@aesaeion.com wrote:
>
> > I have a class that wraps images and I want to be able to set the HTTP
> > headers for the object when it is requested. Which method do you need to
> > override in my python product to catch all requests to that object?
> >
> > Currently the structure is set up such that I have a Picture object and in
> > its dict I store a regular zope Image object. It also stores a thumbnail
> > and a good bit of other information. I want to override however that image
> > gets handed off to the browser or to the rest of zope.
> >
> > Designing the webpages of tomorrow http://webme-eng.com
> > Designing the MMORPGS of tomorrow http://worldforge.org
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>