Remove cache after logout

96 views
Skip to first unread message

News Aanad

unread,
Jun 1, 2011, 1:14:20 PM6/1/11
to RubyOnRails
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?

Bryan Crossland

unread,
Jun 1, 2011, 8:24:37 PM6/1/11
to rubyonra...@googlegroups.com

News Aanad

unread,
Jun 2, 2011, 6:08:13 AM6/2/11
to rubyonra...@googlegroups.com
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.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Asif Nauman

unread,
Jul 17, 2013, 5:36:02 AM7/17/13
to rubyonra...@googlegroups.com
News Aanad 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.

--
Posted via http://www.ruby-forum.com/.

Asif Nauman

unread,
Jul 17, 2013, 5:36:31 AM7/17/13
to rubyonra...@googlegroups.com
Thank You.
Reply all
Reply to author
Forward
0 new messages