Live data from Hacker News

Cloudflare Workers: Run JavaScript Service Workers at the Edge

blog.cloudflare.com

91–100 of 134 posts

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#92

offtopic: can cloudflare be used as a CDN for just assets? The cloudflare docs talk only about using it as CDN for an entire site.

Technically, yes, but as I understand it, they frown upon it and could potentially terminate your account. See this section of their ToS ( https://www.cloudflare.com/terms/ ): >SECTION 10: LIMITATION ON NON-HTML CACHING >You acknowledge that Cloudflare’s Service is offered as a platform to cache and serve web pages and websites and is not offered for other purposes, such as remote storage. Accordingly, you understand…

Wow, thanks for that info! Our enterprise account uses CF as a CDN for medium sized (~50MB) video files and I just assumed that they were ok with everyone doing that. I guess not.

I guess the answer for the OP then is, get an enterprise account and you can do whatever you want.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#93
post #67

Earlier quoted context omitted.

PPS - it is probably too late for this, but one of the last things I worked on at Google was Gin: https://chromium.googlesource.com/chromium/src.git/+/lkgr/gi... A bindings layer for v8 that was specifically intended to make implementing web-style APIs outside of Blink easier. At the time at least, refactoring things like SW out of Blink was ~impossible.

Doh, indeed, wish I had seen that earlier. V8's raw API is... tricky.

Darn, I wish you'd seen it too :). Sounds like you came to similar conclusion I did -- using C++ templates to stamp out v8::FunctionTemplate and ObjectTemplate instances.

I was pretty happy about how Gin turned out and always thought it would be nice to put it on Github where it would be easier for people to reuse.

But at the time Chromium still didn't allow all the modern C++ features, so Gin had to depend on base::Callback, which made it hard to extract cleanly.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#96

  - 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'.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#97

- 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…

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.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#99
post #46

This is probably the best annoucement of a new feature I have ever read. It makes an analogy to an existing technology. It provides a clear description of the new feature. It provides clear examples of how to use the new feature with a link to a sandbox so you can run and modify the examples. And it explains the thought process behind the implementation. In additon, I didn't notice a single typo, spelling or grammar…

You misspelled announcement though. And addition.

Sorry, had to :)

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#100

I read the article, but I'm not sure what this technology is enabling really. Can it be thought of as a new player in the lambda/serverless category? Does it have any advantages to using other serverless stacks like aws lambda or azure?

I guess it's mod_rewrite in js
Post reply on HN