Imagine the user has just completed a complicated multi-page wizard or checkout process and then hits the back button. You may not want to allow the user to backtrack into the previous state; instead you want to refresh the page with something different.
To accomplish this we just need to disable browser caching using appropriate HTTP headers. Here’s the secret:
Taken individually, each of these Cache-Control attributes would seem to prevent caching. In practice,
no-store are usually interchangeable in most browsers. However for the back button cache specifically, Firefox will only disable this cache if
no-store is specified. To play it safe and guarantee cross-browser compatibility, you should use all four attributes.
To implement this in Wicket, we would add the following code to our page class:comments powered by Disqus