Remove cache after logout


#1

Hi,
I have observe Facebook and Gmail that when we logged out it redirects
us to
the login page, but the interesting is that when we hit back button it
still
not go to inbox page.
I have search in google and got something to set attribute
“Cache-control”
in header.
But I don’t know how can we implement this mechanism in Rails.
Can anybody suggest me how to do that?


#2

On Wed, Jun 1, 2011 at 12:14 PM, News A. removed_email_address@domain.invalid
wrote:

Hi,
I have observe Facebook and Gmail that when we logged out it redirects us
to the login page, but the interesting is that when we hit back button it
still not go to inbox page.
I have search in google and got something to set attribute “Cache-control”
in header.
But I don’t know how can we implement this mechanism in Rails.
Can anybody suggest me how to do that?

The step by steps are in the answer.

http://stackoverflow.com/questions/711418/how-to-prevent-browser-page-caching-in-rails

B.


#3

I have tried that but it still not working.
I have tried code in application controler:

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”] = “0”
end

I am using Extjs framwork to design my web page.


#4

Thank You.


#5

News A. wrote in post #1002733:

I have tried that but it still not working.
I have tried code in application controler:

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”] = “0”
end

I am using Extjs framwork to design my web page.

Hi Code is working fine.Thank you.You saved a lot of time.