Hacker News new | ask | show | jobs
by peterwwillis 3186 days ago

  - Is it "Cloudflare Workers" or "Cloudflare Service Workers"?
      A "Cloudflare Worker" is JavaScript you write that runs on Cloudflare's edge.
      A "Cloudflare Service Worker" is specifically a worker which handles
      HTTP traffic and is written against the Service Worker API.
Consufing naming convention. Now you have to say 'worker worker' or 'non-service worker' so nobody has to wonder if you meant 'service worker' when you only said 'worker'.
1 comments

Not really, because once there are workers other than Service Workers, they'll have their own names. To be clear, a Service Worker is one kind of Worker. At the moment it's the only kind, but we could introduce others in the future. For instance, maybe we'd introduce a "DNS Worker" that responds to DNS requests.

Also note we didn't invent these terms. "Workers" and "Service Workers" are W3C standards.

Ok. If you're going to have a DNS worker, wouldn't it make more sense to call the http one the HTTP worker? Isn't DNS a service?
We called it a Service Worker because the API follows the W3C standard Service Worker spec:

https://www.w3.org/TR/service-workers-1/

https://developer.mozilla.org/en-US/docs/Web/API/Service_Wor...

I agree that the naming is not completely intuitive, but these are the names that exist and so we're using them.

I'm not aware of any similar spec for DNS workers so I figure we'll use whatever name we want there.