Avoid caching sensitive pages in Turbo Drive

2550
0

Turbo’s page cache is great until you have sensitive screens (account settings, billing) where the browser back button might show stale content. I handle this by setting cache-control headers and, for specific actions, disabling Turbo caching via turbo_cache_control. This keeps the rest of the app fast while avoiding surprising privacy issues. The goal is not to fight Turbo globally; it’s to be intentional per controller/action. I also try to keep authentication redirects working well for Turbo: return 303 See Other after login/logout so the browser doesn’t retry a POST on refresh. When debugging, I watch the Network tab to confirm Turbo isn’t serving cached HTML.