#815: Skip no-op service worker fetch handler
Discussions
Discussed
Feb 27, 2023 (See Github)
Yves: starts with assumption that it's required to have a fetch handler registered to be identified as a web app... (PWA). If that's the case then i think it's a wrong requirement. I understand this can be a current common practice... looks good as an optimization... but could be removed in the future... Premise is a long one but the solution is a good one as a temporary measure.
Dan: leave that feedback and close?
Yves: Ok can do.
Comment by @ylafon Mar 3, 2023 (See Github)
We looked at this during our last teleconference and we have the following observation: If it is still common practise to register a (potentially) noop, then it should be advertised that it is not a good practise. In the meantime, we see this as a good temporary optimisation, but it would be good to easily roll it back when the number of such cases are low enough. Thanks
OpenedFeb 13, 2023
Wotcher TAG!
I'm requesting a TAG review of skip no-op service worker fetch handler.
Some sites have a no-op (no operation) fetch handler (e.g.
onfetch = () => {}
). Since having the fetch handler was one of the requirements to be a progressive web app (PWA), we assume that they did that to make their site recognized as PWA. However, it only brings overheads to start a service worker and execute a no-op handler without bringing any feature benefits like caching or offline capabilities because the code does nothing. To make the navigation to such pages faster, we would like to omit the service worker start and the handler execution from the navigation critical path if a user agent identifies that the service worker fetch handler is no-op.This is mostly a behind-the-scenes performance improvement. However, it can subtly change the behavior in edge cases, such as dynamically-updated fetch handlers.
Further details:
You should also know that...
[please tell us anything you think is relevant to this review]
We'd prefer the TAG provide feedback as (please delete all but the desired option):
🐛 open issues in our GitHub repo for each point of feedback