What's the best approach to disable the back/forward browser cache? #384
Unanswered
JacobSNGoodwin
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I'll note that a much easier example is solid-start's own with-auth example, where you can log out, and the click the browser back button to show the page. I've tried some some cache header controls and some client-side workarounds. I had no luck with the former, and the latter will always show the page momentarily before reloading the page. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on page which requires an authorized user to manage a list of data. When the user logs out, I redirect them to a login page.
However, if I press the back button, the browser back/forward cache takes over, and displays the last page (see point 4 in the cache documentation). As far as I can tell from the code, this cache lasts 180000 ms: cache.ts
I would prefer that the user is not able to see the content of the page which requires an authorized user. It's not the end of the world, as taking any future action on the authorized data would eventually land them back at a login page. But I still don't like the idea of showing that cached data.
Is there any mechanism for accomplishing this? Maybe via some client side code and action?
This is an example of a layout for a page using solid-start's FileRouter. I've tried playing around with the
load
function, but am struggling to figure this out.Example Route
Beta Was this translation helpful? Give feedback.
All reactions