This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes How can I prevent to  store image in browser 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 » JSP
Bookmark "How can I prevent to  store image in browser cache" Watch "How can I prevent to  store image in browser cache" New topic
Author

How can I prevent to store image in browser cache

Vinoth Thirunavukarasu
Ranch Hand

Joined: Dec 18, 2008
Posts: 164

Hi,
Anybody tell me. How can I prevent to store image in browser cache. Every time the image should get from server and I should prevent to use images from cache.

Regards,
Vinoth.


Java Best Practices
Linux Best Practices
Amortization Calculator

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

To what aim? If your aim is so that a fresh image will be fetched each time because the image is changing, you can serve the image through a servlet and set the no-cache headers (as described the FAQ). If your aim is to prevent the users from saving the images to their local disk, you are out of luck. If the browser can display the image, the user can save it.

So what is your actual goal?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can I prevent to store image in browser cache