You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Christian J. Dechery" <ch...@finep.gov.br> on 2002/09/04 16:27:43 UTC

problems with browser cache

How can I prevent the broswer from using the cache when loading a JSP with a 100% certainty?
 
I'm experiencing a reaaaaaaally weird cache problem... I have a page that includes items in table, and when an item is included it reloads itself so the new item can be shown, but sometimes the new item shows, and sometimes it doesn't... I even play with the refresh because it's completely random.
 
Even if I delete the item, it sometimes still shows...
 
I put this line at the top of my JSP but it seems not to acomplish anything...
<% response.setHeader ("Pragma", "no-cache"); %>
 
any ideas??
 
thanks
 
.:| Christian J. Dechery
.:| FINEP - Depto. de Sistemas
.:| christian@finep.gov.br
.:| (21) 2555-0332


Re: problems with browser cache

Posted by Tim Funk <fu...@joedog.org>.
Added a bogus parameter to the URL which guarantees a unique URL.
ex:
<A HREF="foo.jsp?bogus=<%System.currentTimeMillis()%>">Foo</A>

Christian J. Dechery wrote:
> How can I prevent the broswer from using the cache when loading a JSP with a 100% certainty?
>  
> I'm experiencing a reaaaaaaally weird cache problem... I have a page that includes items in table, and when an item is included it reloads itself so the new item can be shown, but sometimes the new item shows, and sometimes it doesn't... I even play with the refresh because it's completely random.
>  
> Even if I delete the item, it sometimes still shows...
>  
> I put this line at the top of my JSP but it seems not to acomplish anything...
> <% response.setHeader ("Pragma", "no-cache"); %>
>  
> any ideas??
>  
> thanks
>  
> .:| Christian J. Dechery
> .:| FINEP - Depto. de Sistemas
> .:| christian@finep.gov.br
> .:| (21) 2555-0332
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>