File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Avoid browser caching on the server side Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Avoid browser caching on the server side" Watch "Avoid browser caching on the server side" New topic
Author

Avoid browser caching on the server side

Eric Juneau
Greenhorn

Joined: Jul 13, 2009
Posts: 28
I want to update some static content (image files) within my ear without changing the code. I know I can just replace the files themselves, then deploy the static content up to production. However, I want the user to see these new images immediately. I'm afraid of them being cached. Is there any way I can guarantee that the user will see the new images? Will renaming them in the filename and jsp make them uncached?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Eric Juneau wrote: Will renaming them in the filename and jsp make them uncached?


Um, yes because it will be a different file.

Look at this thread: http://www.coderanch.com/t/122075/HTML-JavaScript/window-location-bypassing-cache#603509
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Browsers cache by URL -- if the URL changes, a cached resource with a the original URL cannot be served.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Avoid browser caching on the server side
 
Similar Threads
use of WebServers infront of enterprise app server
webserver vs application server
How to specify resources for your custom tag component
Include HTML as static resource
Thread Newby - Just need a bit of advice