Hacker News new | ask | show | jobs
by angersock 3185 days ago
This is really cool...but why?
3 comments

I thought of a few use cases...

A more granular way to block requests than what cloudflare provides (IP, BGP AS, country)

Tokenizing credit cards at the edge if you have a payment provider that supports that, and are using CF's PCI compliant environment.

Injecting a unique ID into requests for log correlation. You get collisions if you do this via browser javascript for various reasons. I'm assuming v8 has a better Math.random(), or that you would at least be able to find a workaround since it's in one stack.

I'm sure there's more.

Also some good use cases. :)
The post spends like 15 paragraphs explaining why.
Not helpful, unlike your sibling comments.
I worked for an analytics company at one point and we generated impression IDs server side (you'd be surprised how broken client-side JS randomness can be) and included them in our loader. If we had been using CloudFlare I would have put our loader directly into this service worker so that we could shave a few more milliseconds off our intial response time, so that we could get to our cached JS faster.

So yeah, if you care about milliseconds :)

Ah, that makes more sense. Thanks!