Dear all
Can rails reset session if user click the back button in browser?
say,
- go to 应用宝官网-全网最新最热手机应用游戏下载
- Search something and display the result
- go to http://another_server.com
- click back button, I still can see the result in browser, but I don’t
want to see the browser cache…
Any idea to implement this feature? Please advise. Million thanks…
Valentino
Valentino L. wrote:
Dear all
Can rails reset session if user click the back button in browser?
say,
- go to http://myapp.com/controller
- Search something and display the result
- go to http://another_server.com
- click back button, I still can see the result in browser, but I don’t
want to see the browser cache…
Any idea to implement this feature? Please advise. Million thanks…
Valentino
Have you tried setting a
Cache-Control: no-cache, no-store
in your header?
Or an expires header?
or the ‘varying URL’ trick…
There is some (fairly aged) info at
Thanks for your reply
I put the following code in my application controller
before_filter :set_cache_buster
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store,
max-age=0, must-revalidate"
response.headers[“Pragma”] = “no-cache”
response.headers[“Expires”] = “Fri, 01 Jan 1990 00:00:00 GMT”
end
It will not cache the dynamic content if back button is pressed, but the
session is still here…
Many thanks
Valentino
Ar Chron wrote:
Have you tried setting a
Cache-Control: no-cache, no-store
in your header?
Or an expires header?
or the ‘varying URL’ trick…
There is some (fairly aged) info at
Two Important Differences between Firefox and IE Caching | HttpWatch BlogHttpWatch Blog