Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no-cache not expiring web page

 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the below servlet A i am able to get the no cache to work so when i hit the back button the page is expired.

I am using this same exact code in another servlet. The only differenc i can think of is the i am using the PRG patten with it. So i do a process then it redirects to servlet B and displays the invoice page. However if i hit back from here the page is not expired and will still display.

any ideas?

thanks john


SERVLET A


SERVLET B



[ December 06, 2008: Message edited by: John Schretz ]

[ December 06, 2008: Message edited by: John Schretz ]
[ December 06, 2008: Message edited by: John Schretz ]
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you are aware, the whole point of the PRG pattern is to prevent double submit when you refresh the result page after a post request. Hence using a redirect instructs the browser to initiate a brand new request. So you are not getting a "page expired" error message anymore when you go back to the previous page which is not been cached by the browser.

I think this is what is happening. However, the more knowledgeableand very helpful folks here will probably have a better explanation.
[ December 06, 2008: Message edited by: Bosun Bello ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic