RE: [Zope] how to invalidate an object in the cache?

2000-07-02 Thread Marc Boschma

Sounds like you need to manipulate the expiry time for the objects. I'd
suggest that that can either be done in the RESPONSE or via meta tags in the
standard_html_header to mark the page and the image as non-cacheable.

I'm actually interested in a Guru's response on this as I will need to set
the expiry explicitly to save load on the server for content that is
dynamically generated but doesn't change often.

Marc

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Marco
 Mariani
 Sent: Sunday, 2 July 2000 9:08 AM
 To: [EMAIL PROTECTED]
 Subject: [Zope] how to invalidate an object in the cache?



 I am working with photo rotating/resizing, via PIL on external
 method.

 All the images are kept on LocalFS.

 There is a thumbnail bonanza page, when I select a thumbnail a
 form is shown, and I can adjust rotation/contrast/brightness.
 Upon submit, the new image+thumbnail is calculated and written
 to the filesystem.

 Then the method calls RESPONSE.redirect to show the index page again.

 When I go back to the index thumbnail page, the
 image I've just rotated is displayed with the right size (which means
 that Zope gets it right), but not rotated (which means that Netscape
 reads the old image from the cache). I mean, if it was 320x200 and is
 now 200x320, the browser displays the old 320x200 image stretched to
 200x320.

 I'm not digging into contrast and brightness, but the same happens.

 Is there a way to force the browser to discard the cache for that
 image? If I go "right-button, view image, shift+reload" the new
 image is displayed.

 Any idea? I'm not very knowledgeable on this matter, I don't design
 pages for a living.

 Might javascript help?


 Thank you.

 --
 "This company has performed an illegal operation and will be
 shut down.
  If the problem persists, contact your vendor or appeal to a
 higher court."
  - Signal11 on slashdot

 ___
 Zope maillist  -  [EMAIL PROTECTED]
 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  -  [EMAIL PROTECTED]
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 )




Re: [Zope] how to invalidate an object in the cache?

2000-07-02 Thread Marco Mariani

On Sun, Jul 02, 2000 at 03:56:39PM +1000, Marc Boschma wrote:


 Sounds like you need to manipulate the expiry time for the objects. I'd
 suggest that that can either be done in the RESPONSE or via meta tags in the
 standard_html_header to mark the page and the image as non-cacheable.
 
 I'm actually interested in a Guru's response on this as I will need to set
 the expiry explicitly to save load on the server for content that is
 dynamically generated but doesn't change often.


It would work, but I'd have to set up meta tags for LocalFS objects..



I've found a better kludge: when I call the index page, I pass a "refresh" variable 
along
the URL which contains the number of the modified image.

Within the index method, I then call:


   dtml-call "REQUEST.set('id2',id+'_0.jpg')"
   dtml-let img="store[id][id2]"

   A HREF="imageForm?fnum=dtml.url_quote-id;"IMG
   SRC="dtml-var 
"img.absolute_url()+['','?%s'%_.random.random()][REQUEST.get('refresh')==id]""
   
^^
   WIDTH="dtml-var "img.width""
   HEIGHT="dtml-var "img.height""
   ALT="dtml-id;"/A

   /dtml-let


This way, the refreshed image is called with a trailing "?0.283759872" that tricks 
Netscape
to think it's a new object, and reloads.


This could work for you too, maybe.



-- 
"This company has performed an illegal operation and will be shut down.
 If the problem persists, contact your vendor or appeal to a higher court."
 - Signal11 on slashdot

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] how to invalidate an object in the cache?

2000-07-02 Thread Itamar Shtull-Trauring

Marc Boschma wrote:

 Sounds like you need to manipulate the expiry time for the objects. I'd
 suggest that that can either be done in the RESPONSE or via meta tags in the
 standard_html_header to mark the page and the image as non-cacheable.

Read the Cacheability Howto - http://www.mnot.net/cache_docs/

You can set the HTTP headers described there using RESPONSE.setHeader:
RESPONSE.setHeader('Cache-Control', 'no-cache')

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope maillist  -  [EMAIL PROTECTED]
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] how to invalidate an object in the cache?

2000-07-01 Thread Marco Mariani


I am working with photo rotating/resizing, via PIL on external
method.

All the images are kept on LocalFS.

There is a thumbnail bonanza page, when I select a thumbnail a
form is shown, and I can adjust rotation/contrast/brightness.
Upon submit, the new image+thumbnail is calculated and written
to the filesystem.

Then the method calls RESPONSE.redirect to show the index page again.

When I go back to the index thumbnail page, the
image I've just rotated is displayed with the right size (which means
that Zope gets it right), but not rotated (which means that Netscape
reads the old image from the cache). I mean, if it was 320x200 and is
now 200x320, the browser displays the old 320x200 image stretched to
200x320.

I'm not digging into contrast and brightness, but the same happens.

Is there a way to force the browser to discard the cache for that
image? If I go "right-button, view image, shift+reload" the new
image is displayed.

Any idea? I'm not very knowledgeable on this matter, I don't design
pages for a living.

Might javascript help?


Thank you.

-- 
"This company has performed an illegal operation and will be shut down.
 If the problem persists, contact your vendor or appeal to a higher court."
 - Signal11 on slashdot

___
Zope maillist  -  [EMAIL PROTECTED]
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 )