Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cache Control

 
Bunty Paul
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I have few jsp pages and in order control the cache i set the header info to "no-cache". It's working fine but my problem now is i am repeating this "header" in every jsp page.

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


IS there any solution so that it is specified globally or can i specify it in web.xml.

Server used : jboss 4.0.3SP1
Browser : IE 6.0

Thanks,
Paul
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No but you could create either a custom tag or an include that will reduce the code to one line per page.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could do this with a filter too.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic