Hi!

>Could your browser be caching the image?

Images are cached really hard in browsers, specially IE. There are a few
ways of avoiding this. First of all, add this to your servlet to tell the
browser not to store the content in its cache:

  response.setHeader("Cache-Control", "no-cache");
  response.setHeader("Pragma", "no-cache");
  response.setIntHeader("Expires", 0);

This will minimize the browsercaching but it's not 100% accurate. To be
really sure the client recieves an uncached version of the image from your
servlet append a random number to the URL calling the image:

http://localhost/servlet/ImageServlet;123456789

or

http://localhost/servlet/ImageServlet?123456789

Make sure to use a pretty large span of numbers for this, you don't want two
identical requests from the same client.

Brgds
Mathias


-----Ursprungligt meddelande-----
Fr�n: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]F�r Richard Yee
Skickat: den 20 mars 2002 11:14
Till: [EMAIL PROTECTED]
�mne: Re: When does a servlet reloads/recalculates ?


Could your browser be caching the image?

Put some debug code in the servlet to print to the console.  It should
print each time a request is sent.

-Richard

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to