Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The benefit of the service worker is that they can intercept all fetch events and would allow you to move validation code out of the thread that is running the UI. It can make for a simpler client, but really it's just shifting the complexity to another layer. However, there are a lot of potential benefits to service workers (eg. caching, background downloads, notifications—tho possibly a negative) so perhaps the added complexity is ok.


Right, but I'd really doubt that "store new auth token if it exists in response" would take long enough that it causes any kind of problem.

I know that there are benefits to using service workers in general, I guess I was just thinking about it in terms of adding a service worker to an application that isn't currently using them just to do the handshake they're suggesting. In which case it would be a lot of added complexity and wouldn't work across the board, whereas doing the check on the server side would add very little complexity and would work with every browser made since about 1995.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: