< Back

Document Subject: Allow back to search results without error
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#BackToSearchCache or http://A555F9/nn.nsf/ByAlias/BackToSearchCache

I implemented a website with a search interface using the standard "viewname questionmark SearchView ampersand query equals"  url code. When a user clicked on a result and then clicked back on the browser to go back to the search results the error 'Warning: Page has Expired' came up . Turns out to be an easy fix.




 

This happens because the browser has not cached the page because the header has not instructed it to cache it. When &query is used the browser assumes the page has been created using a form post response and so by default prevents the page from being reopened as a security measure.

 

Putting this in the HTML Head Content event of the $$SearchTemplateDefault form:

"<META HTTP-EQUIV=\"Pragma\" CONTENT=\"cache\">"

allows users to go back in the browser without getting the error.

 

NB Alternatively to force the user to resubmit the search you can put in:

"<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">

but why would you want to do that ? : )