Diving into Technical SEO Using Cloudflare Workers
blog.cloudflare.com
blog.cloudflare.com
I don't like being that guy who asks for free stuff, but a free tier would at least mean that I get to spend an hour or two trying the feature out. Not that $5 is a prohibitive cost, but Workers haven't sounded good enough to take my credit card out for.
I agree, developers in general will adopt faster if it’s free, or if there is a reasonable trial period, but in this case I am wondering if there’s more to this.
We hear you. Head on over and reserve a subdomain, free.
We have a runtime that can be used similarly to Cloud Flare workers. You can even write JS that runs on both since we both target the browser's Service Worker API.
You can run it locally, deploy it on our servers (free credit for the first $25 of usage), or if you're a little crazy you can even deploy it to your own servers: https://github.com/superfly/fly
Go sign up now.
The author points out that you should just handle redirects in the platform if you can. For hreflang tags, is there a reason besides using a legacy system that you need to inject hreflang tags outside your app/platform?
And if you decide to move from Cloudflare to another major CDN provider, you will have to change how your product works?
Because that's what StackOverflow and Reddit did. They are not using Cloudflare anymore.
So, does using Cloudflare Workers create a serious vendor lock-in, that makes changing a CDN provider much more costly in the future?
EDIT: I am thinking primarily about Fastly, as it's where the majority of large players move from Cloudflare. Also, about KeyCDN, which can be a much more cost-efficient alternative to the Cloudflare's Enterprise plan.
I believe you'd need to port your CDN code when moving on any of those platforms though. You might get away without re-architecting anything else.
You can write JavaScript that runs just fine on both fly.io and Cloud Flare workers. We both target the in browser Service Worker API. We actually have a few users that deploy the same code to us + Cloud Flare, and use our runtime for local testing + CI: https://github.com/superfly/fly
We have a serverless product that is very similar to Workers. Our global footprint can handle 65tbts and we also do distributed containers and VMs at the edge. We also don’t require users to use our DNS.
Can you shoot me an email? ben.gabler (at) stackpath (dot) com
CDNs are commodity so it's really the extra features that cause companies to move. With something like Workers that allow you to build whatever functionality you want, it actually reduces reasons to move in the first place. Also CF doesnt charge for bandwidth which is a unique advantage.
CDNs are designed to forward requests to a origin server and cache the results, but you can serve your site completely from Workers if you embed all the code and data into the deployed script or store content in KV.
1) Working on a project right now that provides edge-level analytics for your sites w/ a focus on privacy: more accurate than Google Analytics (JS blockers remove ~1/3 of your traffic stats) and less icky for your users. Funny this comes up, I'm putting together a list for people who are interested in beta testing, if that sounds appealing: https://xyz.us16.list-manage.com/subscribe?u=0b8a0e873d096aa...
2) Extreme caching on a Wordpress site – using Cloudflare's edge cache WP plugin[1] and the worker from the workers-example repo[2] – currently at a 97% cache hit rate across the site.
update: just double-checked the cache hit stat on Cloudflare, after writing this comment - actually have a 99.95% cache rate as of today (!)
[1] https://wordpress.org/plugins/cloudflare-page-cache/
[2] https://github.com/cloudflare/worker-examples/tree/master/ex...
I'd love to hear more about this – could you elaborate? Any resources you can share to back it up? Thx!
In financial services, we see about 15% higher unique users per day when analyzing HTTP logs versus Google Analytics. In fact, I’ve heard but not verified that GA now applies a “correction factor” to their stats to account for this.
Another approach to this using Workers:
Their JavaScript environment/APIs are not standard and there’s no proper spec that I could find.
The debugging environment/IDE is decent for an in-browser one but we had some horrible issues with a stale version being loaded from local storage and accidentally applied to the entire site effectively bringing us down for several minutes.
On every change I also saw several error pages myself during warmup period which made me wonder how many customers were getting them.
This was all ~6 months ago though so things might have improved since then.
Performance wise we’re very happy with it though as it beats the Apache reverse proxy it replaces hands down.
It's not running in a browser so they reimplemented some things but the overall API surface is the same. They also have some extra APIs for CF only features.
Debugging is a problem though, but there's another project called Cloudworker that emulates a local instance: https://blog.cloudflare.com/cloudworker-a-local-cloudflare-w...
You can run CF worker code locally, write tests, etc using our edge app runtime: https://github.com/superfly/fly
> When the second barrier arose, we needed to inject Hreflang tags, cross-linking an old multi-lingual website on a bespoke platform build to an outdated spec. This required experiments to find an efficient way of implementing the tags without increasing latency or adding new code to the server – in a manner befitting of search engine crawling.
Is this a primary use case? When it's not practical to make the changes at the origin server?
What are the use cases when you are able to make server changes more easily?
Can you test what workers will do on a local development site somehow?
One major use-case, yes. "We'll pay big bucks for you to fix the website. But also, we can't make any changes to the website." Fine, "patch" it with Cloudflare, just one more layer on top of the un-fixable mess for the next guy to deal with (in exchange for even bigger bucks).
- Redirects: We have several clients in the tech industry who host their docs and pages on Github pages. Github pages doesn't support 301s. This allowed us to both create 301s correctly and have a more manageable 301 platform for the non-development team.
- A/B testing through ghosting: A very large e-commerce client of ours wanted to run A/B test by ghosting (not to change URL) and slow roll out of the new platform. Through this they could chose which URL's were on the new platform and which ones on the old one and slowly rolled it all out.
In the future you will also be able to create pipelines so that there is a better management and audit process for bigger firms with security protocols around.
So, there are more benefits to this than just "When it's not practical to make the changes at the origin server". Infact if you are just "patching" then it's trouble.