Hacker News new | ask | show | jobs
by renke1 3182 days ago
So, can I use this to do this:

Render your SPA (different index.html) when a login cookie is set and otherwise render your landing page (yet another index.html)? - Such that that my http://example.com can always be cached (unless it needs to hit the server where the same logic is implemented).

And in general, how do you manage your landing page vs. your SPA?

2 comments

Maybe I’m not quite understanding what you’re asking, but I think you can do this with client side service workers already.
Yep. At the origin you might serve the SPA as /spa.html and the worker rewrites the URL for people hitting /.