Re: [w3c/ServiceWorker] Skip executing fetch handlers if it is no-op. (PR #1672)

@yoshisatoyanagisawa commented on this pull request.



>  
               1. Set |script|'s <a>has ever been evaluated flag</a>.
+              1. If the [=Empty Handler identification=] algorithm with |workerGlobalScope| returns true, the [=all fetch listeners are empty flag=] is set.

I think you are talking about [Approaches to deal with the handler updates after the initialization](https://github.com/yoshisatoyanagisawa/service-worker-skip-no-op-fetch-handler#approaches-to-deal-with-the-handler-updates-after-the-initialization) in the explainer.  This implements [Option 2](https://github.com/yoshisatoyanagisawa/service-worker-skip-no-op-fetch-handler#option-2-updates-are-checked-every-time-when-the-service-worker-starts).  However, this just set "all fetch listeners are empty flag", and never unset.  Upon the algorithm, once the flag is set, it would be kept and does not behave like Option 2 (i.e. the fetch handler function body is evaluated every time service worker starts).  Let me fix.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1672#discussion_r1113758671
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1672/review/1308426578@github.com>

Received on Wednesday, 22 February 2023 02:22:13 UTC