aspose file tools*
The moose likes Servlets and the fly likes servlets and cache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets and cache" Watch "servlets and cache" New topic
Author

servlets and cache

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
I have just been looking at my site from the library and they must use a proxy server and when you update a page it does not show they changes until you refresh. How can I stop this.
thanks
david
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
you can set an entry in the HTTP header. Just set in your response

This shows the Proxy to not cache the side.
This is the entry for Http 1.1 for Http 1.0 it is slightly different as
far as i can remember. You can check this on the W3C page
Gayan Balasooriya
Ranch Hand

Joined: Jul 31, 2002
Posts: 51
This method disables caching at the proxy and client browser
// Set to expire far in the past.
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
// Set standard HTTP/1.1 no-cache headers.
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
// Set standard HTTP/1.0 no-cache header.
response.setHeader("Pragma", "no-cache");
Gayan Balasooriya
SCJP,SCWCD
http://www.gayanb.com - Free Java/J2EE books and mock exams
[ October 21, 2003: Message edited by: Gayan Balasooriya ]

SCJP, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlets and cache