• 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

Problem with cache and session

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have a big problem when caching with Internet Explorer 6.0. In order to prevent caching to all my Struts Actions, I have created a class called BaseAction that implements cache control:

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

All my Struts Actions extend my BaseAction class. The problem is that, when I click the back button, IE shows the error page "The page cannot be displayed".

The problem does not occur if I disable the first two headers:

//response.setHeader("Cache-Control","no-cache");
//response.setHeader("Cache-Control","no-store");

In order to see what IE does when I click the back button, I have made a snoop of tcp/http traffic. IE does not send anything (neither a bite!) to the server when I click the back button.
Furthermore, the problem does not occur when using Firefox 1.0.3 (it shows the message "the page contains POST data - do you want to resend data?").

Can anybody help me please? Thanks in advance.
David
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's working properly, it's just not what you expected.

I believe what you are looking for is the functionality of the PRG Pattern.
reply
    Bookmark Topic Watch Topic
  • New Topic