jacobgoodwin
Is there any approach to invalidate the back/forward browser cache in solid-router (v 0.12.x)?
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.
3 replies
is it possible to use matchFilters from @solidjs/router in file routes?
I'm not sure if this is the preferred approach, but you do have access to the params in the
The good news is the blow seems to work with
load
function.
So you might be able to do something like below, where I wrapped the validateFileId
in a cache
because I believe this is the only way to properly handle either returning a redirect
.
I've become used to using throw redirect
, but I was having issues with this and I'm not sure why, but returning a redirect
seems to work (maybe a recent API change, as I just created a fresh solid-start repo, and it's now v 0.6.0, as of today).The good news is the blow seems to work with
solid-start
with bother CSR and SSR.
6 replies