0

I have a Rail app where the user can switch tenants. The issue is that in production the browser is caching the old client HTML etc.

I came across this:

How do we control web page caching, across all browsers?

headers["Cache-Control"] = "no-cache, no-store, must-revalidate" # HTTP 1.1.
headers["Pragma"] = "no-cache" # HTTP 1.0.
headers["Expires"] = "0" # Proxies.

I have a controller that sets a session variable and then redirects to root. I want to 'reset' the cache etc. at this point.

Dan Tappin
  • 2,692
  • 3
  • 37
  • 77
  • In my application we're using `session[:object]` to set the current area. When `session[:object].nil?` we redirecting to the login. Can you use a similar concept? – Archer Dec 07 '19 at 14:40
  • @Archer that’s what we have and that’s not the issue. The browsers (Chrome and Safari tested so far) both keep using cached versions of the nav bars etc. Worse is it’s random to the user. You see the tentant name and things like count badges switch at random and you can see zero actual hits on the server. Until you do a few manual client refreshes it does t catch up. – Dan Tappin Dec 07 '19 at 17:02

0 Answers0