[Zope] Browser Sticky Fingers

Duncan Booth duncan@rcp.co.uk
Wed, 20 Oct 1999 10:46:13 +0000


> What if the image object had an expires property that, when set, would
> include those headers, and when unset would be 'normal' non-expiring
> images? By default, the property would be unset, of course. This seems,
> IMHO, to be a zopish way of doing it.

A zopish way to do it might be to define a DTML Method called 
'expired' that sets the expired header and then returns the object you 
originally wanted. This seems to work for images:

  <dtml-var "RESPONSE.setHeader('Expires', '1 January 1970')">
  <dtml-return "PARENTS[0].index_html(REQUEST, RESPONSE)">

If you have an image .../somepath/image.gif and 'expired' is 
somewhere in 'somepath' or above, you can simple retrieve 
.../somepath/image.gif/expired to get a pre-expired image. 
In netscape you can view the image info for the expired and normal 
versions of the image and see that the expiry date changes 
accordingly.

-- 
Duncan Booth                                             duncan@dales.rmplc.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
http://dales.rmplc.co.uk/Duncan