• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cache Control

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I have problem here. I am using jsp in my project.My problem is i shouldn't allow the user to navigate back.when he clicks the back button in the browser, he should get WARNING AGE EXPIRY message.So how to go about this.I used the following lines of code
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
It did not work.What do i need to do.Do i need to set some properties in the web server?
I am using tomcat3.2 version.
Thanx in advance
Kiran
[ January 16, 2004: Message edited by: Mark Spritzler ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no sure fire way of handling this, I usually use

But there was also a suggestion in a previous thread that suggested that it might be possible to open a new browser window and make sure the previous window closes itself. I'd call that a bit yucky but it does solve the problem.
Dave.
 
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David O'Meara:
There is no sure fire way of handling this, I usually use


This may work for pages that are getting served by your servlet. But what about static pages that are in fact getting served by the DefaultServlet. How do I make them un-cacheable. My problem is I have a page with many links to static resources say .mp3 files that I do not wanna cache... And I want to handle this at the server side(I have gone through the options available at the client side but feel would be better if this is handled at the server). How do I do this.. Is there some kinda management console where I can say "DO not cache my *.mp3 files" and the server i.e. DefaultServlet would add the respective headers whenever it serves an .mp3 file for me?? Or is there any other way out....
Regards
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kiran. I removed the "Urgent" in your topic title. This way you can get more responses. Usually people skip over posts that say urgent.
Mark
 
No holds barred. And no bars holed. Except this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic