<?xml version="1.0" encoding="utf-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><script src="https://www.rss.style/js/atom-style.js" xmlns="http://www.w3.org/1999/xhtml"/><title>Tower of Kubes</title><link rel="self" type="application/atom+xml" hreflang="en" href="https://www.towerofkubes.com/tags/static/feed.xml"/><link rel="alternate" type="text/html" hreflang="en" href="https://www.towerofkubes.com/tags/static/"/><link rel="alternate" type="application/rss+xml" hreflang="en" href="https://www.towerofkubes.com/tags/static/index.xml"/><id>/</id><updated>2025-11-18T00:00:00Z</updated><author><name>Ro'i Bandel</name></author><generator>Hugo 0.157.0</generator><entry><title>Cloudflare Workers</title><link rel="alternate" type="text/html" hreflang="en" href="https://www.towerofkubes.com/articles/cloudflare-workers/"/><id>https://www.towerofkubes.com/articles/cloudflare-workers/</id><updated>2025-11-18T00:00:00Z</updated><summary type="html">Although Cloudflare Pages is still around, &lt;a href="https://blog.cloudflare.com/pages-and-workers-are-converging-into-one-experience/"  target="_blank" rel="noreferrer">since 2023&lt;/a> Cloudflare has been merging some of the features into Workers. Nowadays, while both Pages and Workers can be used, Workers is the preferred option. Workers now has all the same static asset hosting features as Pages, plus additional features.</summary><content type="html"><![CDATA[
<h2 class="relative group">Introduction
    <div id="introduction" class="anchor"></div>
    
</h2>
<p>I have been considering different options for hosting static-sites for free. In my personal notes, I previously wrote about three differenet services for static website hosting: GitHub Pages, Cloudflare Pages and Codeberg Pages. Two of these options now have more modern alternatives: <a href="/articles/grebedoc/" >Grebedoc</a> instead of Codeberg Pages and Cloudflare Workers instead of Cloudflare Pages.</p>

<h2 class="relative group">Cloudflare Workers vs Cloudflare Pages
    <div id="cloudflare-workers-vs-cloudflare-pages" class="anchor"></div>
    
</h2>
<p>Although Cloudflare Pages is still around, <a href="https://blog.cloudflare.com/pages-and-workers-are-converging-into-one-experience/"  target="_blank" rel="noreferrer">since 2023</a> Cloudflare has been merging some of the features into Workers. Nowadays, while both Pages and Workers can be used, Workers is the preferred option (<a href="https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/"  target="_blank" rel="noreferrer">Migrate from Pages to Workers · Cloudflare Workers docs</a>). Workers now has all the same static asset hosting features as Pages, plus additional features.</p>

<h3 class="relative group">Pricing
    <div id="pricing" class="anchor"></div>
    
</h3>
<p>In terms of pricing, <a href="https://www.cloudflare.com/plans/developer-platform/"  target="_blank" rel="noreferrer">Workers & Pages Pricing | Cloudflare</a> lists the prices for both Workers and Pages. At first glance, the Workers Free tier appears to be more limited than Pages Free tier. Pages Free boasts “Unlimited sites”, “Unlimited requests” and “Unlimited bandwidth”, while Workers Free says “Includes 100k requests per day”, which is a far cry from “unlimited”. However, delving into the <a href="https://developers.cloudflare.com/workers/static-assets/billing-and-limitations/"  target="_blank" rel="noreferrer">Cloudflare Worker docs</a>, reveals the distinction:</p>

    <div class="admonition quote">
      <div class="admonition-header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"/></svg>
        <span>Quote</span>
      </div>
      <div class="admonition-content">
        <ul>
<li>Requests to static assets are free and unlimited. Requests to the Worker script (for example, in the case of SSR content) are billed according to Workers pricing. Refer to <a href="https://developers.cloudflare.com/workers/platform/pricing/#example-2"  target="_blank" rel="noreferrer">pricing</a> for an example.</li>
<li>There is no additional cost for storing Assets.</li>
</ul>
      </div>
    </div><ul>
<li><a href="https://developers.cloudflare.com/workers/static-assets/billing-and-limitations/"  target="_blank" rel="noreferrer">Billing and Limitations · Cloudflare Workers docs</a></li>
</ul>
<p>Therefore, my understanding is that Cloudflare Workers is free and unlimited for static assets, and only costs money with requests to Worker scripts (importantly, clients loading static assets do not count as “requests”). This is essentially the same as Cloudflare Pages pricing, it only starts to potentially cost money if you go beyond what Pages can do and into other Worker features.</p>

<h2 class="relative group">Why use Cloudflare Workers?
    <div id="why-use-cloudflare-workers" class="anchor"></div>
    
</h2>
<p>Despite today’s outage, I find Cloudflare to be generally reliable and use its free tier for most of my self-hosted websites and services. The only thing I pay for is domain registration, and domains are fairly priced (offered <a href="https://www.cloudflare.com/application-services/solutions/low-cost-domain-names/"  target="_blank" rel="noreferrer">at cost</a>). Many people have concerns over Cloudflare’s control of the web. I understand those concerns but it’s not something that I personally worry about. I enjoy taking advantage of their generous free tier either way.</p>
<p>Because I already use Cloudflare as my domain registrar, it makes sense to also take advantage of their static website hosting features and the included unlimited traffic.</p>

<h3 class="relative group">Compared to GitHub Pages
    <div id="compared-to-github-pages" class="anchor"></div>
    
</h3>
<p>Both Cloudflare Pages and Workers have less limitations than GitHub Pages. The most notable limitation of GitHub Pages that I can find is that the <a href="https://github.com/pricing"  target="_blank" rel="noreferrer">free tier</a> of GitHub Pages and wikis only allows using “Public repositories”.</p>

<h3 class="relative group">Compared to self-hosting
    <div id="compared-to-self-hosting" class="anchor"></div>
    
</h3>
<p>Self-hosting a website is possible as I have the infrastructure for it at home. After I completed the bootcamp, I kept my final project (<a href="https://github.com/roib20/petinvent"  target="_blank" rel="noreferrer">PetInvent</a>) up for several months on a self-hosted Docker Compose stack (PetInvent + PostgreSQL + nginx), which was running on my homelab along my other other self-hosted services. However, I don’t have the same uptime as Cloudflare. And even if I did, I still rely on Cloudflare anyway (Tunnels + domain), even for self-hosting. I might as well use their hosting as well if it doesn’t cost me anything.</p>

<h2 class="relative group">Documentation
    <div id="documentation" class="anchor"></div>
    
</h2>
<p>Some relevant pages from <a href="https://developers.cloudflare.com/workers/"  target="_blank" rel="noreferrer">Cloudflare Workers docs</a>:</p>
<ul>
<li><a href="https://developers.cloudflare.com/workers/"  target="_blank" rel="noreferrer">Overview · Cloudflare Workers docs</a></li>
<li><a href="https://developers.cloudflare.com/workers/framework-guides/"  target="_blank" rel="noreferrer">Framework guides · Cloudflare Workers docs</a></li>
<li><a href="https://developers.cloudflare.com/workers/static-assets/"  target="_blank" rel="noreferrer">Static Assets · Cloudflare Workers docs</a></li>
</ul>

    <div class="admonition tip">
      <div class="admonition-header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M272 384c9.6-31.9 29.5-59.1 49.2-86.2c0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c0 0 0 0 0 0c19.8 27.1 39.7 54.4 49.2 86.2l160 0zM192 512c44.2 0 80-35.8 80-80l0-16-160 0 0 16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z"/></svg>
        <span>Tip</span>
      </div>
      <div class="admonition-content">
        <p>Cloudflare Workers docs have <a href="https://developers.cloudflare.com/workers/framework-guides/"  target="_blank" rel="noreferrer">guides for various frameworks</a> which I am using or considering using, including <a href="https://developers.cloudflare.com/workers/framework-guides/web-apps/react/"  target="_blank" rel="noreferrer">React + Vite</a> and <a href="https://developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/docusaurus/"  target="_blank" rel="noreferrer">Docusaurus</a>. These guides can either be followed directly, or <a href="https://developers.cloudflare.com/workers/get-started/guide/"  target="_blank" rel="noreferrer"><code>npm create cloudflare@latest</code></a> can help bootstrap a project for various frameworks with correct Workers configurations.</p>
      </div>
    </div>
<h2 class="relative group">Can I use Cloudflare Workers for my projects?
    <div id="can-i-use-cloudflare-workers-for-my-projects" class="anchor"></div>
    
</h2>
<p>Based on the docs, Cloudflare Workers may be ideal for <a href="https://docs.calme.win/"  target="_blank" rel="noreferrer">CALMe</a>, which uses React + Vite for the frontend and Docusaurus for the documentation. My current goal is to set up a Continuous Deployment for <a href="https://docs.calme.win/"  target="_blank" rel="noreferrer">CALMe</a>, with the <code>main</code> branch deploying live to my FQDN on Cloudflare using Cloudflare Workers. After I get <code>main</code> working, I can setup a fancier CD flow with previews on pull requests.</p>
<p>For my personal website, I was leaning towards using <a href="https://gohugo.io/host-and-deploy/host-on-cloudflare/"  target="_blank" rel="noreferrer">Hugo, which works with Cloudflare Workers</a>.</p>
<hr>
<p><em>Featured image by <a href="https://unsplash.com/@sharadmbhat?utm_source=hugo&utm_medium=referral"  target="_blank" rel="noreferrer">Sharad Bhat</a> on <a href="https://unsplash.com/?utm_source=hugo&utm_medium=referral"  target="_blank" rel="noreferrer">Unsplash</a>.</em></p>
]]></content><author><name>Ro'i Bandel</name></author><category term="spa" label="Spa" scheme="https://www.towerofkubes.com/tags/spa/"/><category term="static" label="Static" scheme="https://www.towerofkubes.com/tags/static/"/><category term="cloud" label="Cloud" scheme="https://www.towerofkubes.com/tags/cloud/"/><category term="cloudflare" label="Cloudflare" scheme="https://www.towerofkubes.com/tags/cloudflare/"/><category term="ci/cd" label="Ci/Cd" scheme="https://www.towerofkubes.com/tags/ci/cd/"/><category term="self-hosted" label="Self-Hosted" scheme="https://www.towerofkubes.com/tags/self-hosted/"/><published>2025-11-18T00:00:00Z</published></entry></feed>