I recently needed to make a page expire so that when the user clicked on the back button it didn’t show the page. This was required for two public computers used for registrations. While I could disable the back button the backspace key in IE continued to work as a keyboard shortcut for it.

Thankfully this only applied to two computers running IE 7. I tried all of the usual suspects to expire the page or disable caching

  • Set Pragma: no-cache
  • Set Cache-control: no-cache, must-revalidate
  • Expire the page in the past
  • Expire the page at the time it was sent

What I found is that if you do any of these then IE ignores your attempts to expire the page. The solution that worked for me was

  • Set Cache-control: must-revalidate
  • Expire the page at least 1 second into the future