Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Not to cache image-only  RSS feed

Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys I'd like to know if it's possible not to cache only some parts of your page. For example, a certain image. I want this in my servlet response. Right now, this is what I have in my response:

response.setHeader("Cache-Control", "no-store");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);

I'm doing this so that whenever a user clicks back the back button, a new image will be generated. Thank you!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!