tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samit Paul" <sp...@ipcelerate.com>
Subject RE: Tomcat 5.5.12 Refresh/Cache problem
Date Thu, 03 Nov 2005 18:16:14 GMT
Thanks a lot guys.  Certainly I misunderstood.

Samit Paul

-----Original Message-----
From: MW Janssen [mailto:maarten@bedrijven.nl] 
Sent: Wednesday, November 02, 2005 2:51 AM
To: 'Tomcat Users List'
Subject: RE: Tomcat 5.5.12 Refresh/Cache problem

that's what i meant.

regards. 

-----Oorspronkelijk bericht-----
Van: Stephan van Loendersloot [mailto:whistle@worldonline.nl] 
Verzonden: woensdag 2 november 2005 4:39
Aan: Tomcat Users List
Onderwerp: Re: Tomcat 5.5.12 Refresh/Cache problem

Samit Paul wrote:
> Arlene,
> Thanks for the reply. My file is a PNG file. Can you tell me where can 
> I put this piece of code.
> Thanks,
> 
> Samit Paul
> 
> -----Original Message-----
> From: Arlene Milgram [mailto:Arlene.Milgram@MEDecision.com]
> Sent: Tuesday, November 01, 2005 8:20 AM
> To: users@tomcat.apache.org
> Subject: RE: Tomcat 5.5.12 Refresh/Cache problem
> 
> 
>   /** Turn on caching:  expire in one hour
>    * @param response The Http Response.
>    */
>   public static void setHeadersCacheOn( HttpServletResponse response ){
>     java.util.Calendar expireDate = java.util.Calendar.getInstance();
>     expireDate.add(java.util.Calendar.SECOND, 30 );
>     response.setDateHeader("Expires", expireDate.getTime().getTime()); 
>     response.setHeader("Cache-Control","public,store,cache"); 
>     response.setHeader("Pragma","cache"); 
>   }
> 
> -----Original Message-----
> From: Samit Paul [mailto:spaul@ipcelerate.com]
> Sent: Monday, October 31, 2005 8:17 PM
> To: users@tomcat.apache.org
> Subject: Tomcat 5.5.12 Refresh/Cache problem
> 
> Can somebody tell me what configuration parameter I need to set to get 
> rid of page not refreshing.
> I have a png image a.png . When I browse from IE it shows me the image 
> properly. Now I put a different image but with the same name a.png.
> Event if I press the browser refresh button , it still does not 
> refresh the image.

<SNIP>

The problem you describe is on a per-browser-per-user-basis, so they will
not work effectively.

In IE for example, you can set the caching through the menu Tools ->
Internet Options -> General and under 'Temporary Internet Files', click
Settings, then under 'Check for newer versions of stored pages content',
select 'Every visit to the page'. Also you can set the number of megabytes
to use for caching to 1Mb.

As said, this totally leaves you up to the visitor's browser settings.

Other suggested options are to add a number of meta-tags or response-headers
like 'Expires', 'Cache-Control', 'Pragma->No-Cache->No-Store',
'Cache-Control->pre-check->post-check' to your pages.

However, the interpretation of these things, *again* differs per browser
implementation per user and per HTTP protocol version these things were
originally designed for.

This has nothing to do with Tomcat or any other webserver.

Some of the meta-tags and response-headers mentioned above even have an
unreliable effect on the browsers 'Back'-button and on search-engines.

The most reliable way I have found is to simply take Maarten Janssens's
advice:

<img src="mypicture.jpg?ms=1130901624937">

or even:

<img src="mypicture.jpg?1130901624937">

Where the value '1130901624937' is the current time in milliseconds.

Maybe you didn't understand his reply and you thought something like:

<img src="1130901624937.jpg">

This would indeed leave you with strange duplicate files. The trick is to
use the time as a parameter appended to the filename, so you can keep the
name your original image.


HTH,

     --Stephan.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 31-10-2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.7/155 - Release Date: 1-11-2005
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message