[Zope-dev] no reload of image in management interface of python product

Dieter Maurer dieter@handshake.de
Fri, 29 Jun 2001 20:57:39 +0200 (CEST)


bdorn@vup.at writes:
 > > > ... modified image not displayed by browser ...

 > Dieter Maurer replied:
 > >The  browser has the image happily in its cache.
 > >You need a "SHIFT" + "RELOAD"

 > thanks - but  isn't there another method - so that the user doesn't have 
 > to reload the page manualy everytime ?
Usually, caching is very good for performance.
Occasionally, you do not like it. Your options:

  *  you can configure the browser how often it should validate
     images (never, once per session, for every request).

     If you chose "for every request", the browser will
     always ask the server to send the image, if
     it is newer than the cached image.

  *  you can tell your image (or all of your images)
     to add cache control headers.

     You can use the "precondition" of Zope images for this.

     HTTP1.1 defines quite comprehensive cache control
     directives. The problem: there are many not-HTTP1.1
     compliant agents (browsers, caches) around.
     Vanilla HTTP1.0 does not provide for cache control.
     Nevertheless, most HTTP processors understand
     the "Expires" header.

     Thus, the best way is probably to use the "Expires".

     Note, that you must use this generally.
     It will not help, when you set the header *AFTER*
     you changed the image. It needs to be set, when
     the browser receives the image.


Dieter