I am working on implementing a service worker which caches and serves an app shell to certain routes on my site.
I am running into a problem in that the route can sometimes (based on a query parameter, say) cause a redirect on the server side. However, once the user is being served an app shell, they never actually hit the server again, and the redirects aren't happening.
This seems like a problem inherent to app shells. Looking for thoughts and guidance on handling cases like these.
Additional details for clarity:
- User hits
https://www.example.com
- Service worker is installed, subsequently serving an app shell for the
/
route - Some time later, the user hits the site again, but their account has been flagged for a security review. Normally, the server would handle this redirection, redirecting the user to, for example,
https://www.example.com/account/security
- However, due to the presence of the app shell, the server has no opportunity to perform such a redirect.