Real world suggestions for workers

Workers / serverless code is a new concept to me, and I’m intrigued :slight_smile: I’ve read through the docs, but I’m not sure what a REAL WORLD use would be.

What value does this bring to a website? Or is it mainly used for apps?

Built with Workers · Cloudflare Workers® are some real world examples.

1 Like

Thanks for the link! I was hoping for something a little more specific, though.

For example, I looked at this one:

https://workers.cloudflare.com/built-with/projects/all-aboard/

I see a form on the page to choose an origin and destination, then the form submits to show results on another page. It’s not particularly fast or anything, and looks like any other form, so how did the use of workers help?

This is the second one that I tried:

https://workers.cloudflare.com/built-with/projects/no-time-for-books/

But the website is in Arabic! And I don’t think it’s the same thing that’s described on the Cloudflare page.

Is the goal to replace the use of curl to fetch data from other sites? That’s the only thing I see in common with these sites.

It didn’t touch an origin? Or it did so in a more efficient manner?

To what use case? The Interwebs are a big place. One can build an entire e-commerce website serverless or change the website url based on visitor country.

I’m hoping to see examples of website usage so that I can figure out a way to use them to make my own sites faster, better, or more efficient. All I’m finding are vague docs, though, and I’m not even sure that I understand the general concept! LOL Much less the specific uses.

I have scripts that are loaded by Ajax on the page, refreshing every minute using setInterval. And then every X number of minutes, the script uses curl to read an RSS feed from another site to get new data. Is this something that would be “better” if done via worker?

Similarly, I have another Ajax script that uses EventSource to show the logged in user when they get a new Private Message by reading MySQL for new rows. Is this something that would be better if done via worker?

Those are certainly things that can be built with workers. There are more examples here Examples · Cloudflare Workers docs and on github. There’s also a developers discord server where there are likely other examples.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.