trifold – trifold

trifold A tool for serving static websites using a content delivery network (CDN).

Source: https://codeberg.org/jpt/trifold/

It allows painless deployment of sites with completely static assets (HTML, CSS, JS, images) for just a penny a month. It is a perfect companion for deploying sites built with static-site generators like Hugo, Zola, Quarto, or Zensickle.

The tool provides a simple CLI that allows:

  • Starting new projects without touching the CDN web interface
  • Syncing local HTML/CSS/JS/etc. Go to CDN and clear cache
  • configuring a custom domain name to point to your files, with SSL enabled
  • Setting a maximum monthly cost to avoid surprise bills
  • Using CDN Edge Functions to support redirects

The project grew out of frustration with services that have made their free tier less friendly to indie developers and students who just need a cheap and reliable place where they can host things.
trifold Cloudflare Pages provides an easy alternative to services like Netlify and GitHub Pages.

Hopefully it will be more stable to rely on a paid service with the ability to set an appropriate price point and billing limits rather than relying on a free service.

installation

if you have uv installed, you can run uvx trifold Without a separate installation step.

This is the recommended method, uvx is a built-in alias for uv tool run(See https://docs,astral,sh/uv/guides/tools/#running-tools if you’re interested in learning more,)

To Upgrade: uv tool upgrade trifold

You can also use any Python package manager of your choice, pip, pipx, poetryetc. to install it in your preferred way.

bunny.net and pricing

currently bunny.net is the only supported provider, but others can be added.

bunny.net is a professional-grade CDN that is also very affordable.

Like most hosts, they charge for both storage and bandwidth. Both start at $0.01/GB/month.

The typical static webpage is less than 1GB, which means unless you decide to host audio/video, storage costs will be negligible. And if you do that, the rates are away Cheaper than most competitors, see their pricing for details.

In terms of bandwidth, let’s say your page size is 2 MB ,a medium-sized page) and it hits the first page of a popular website, giving an increase of 25,000 hits. ,Congrats!,

Not only will your site handle the traffic just fine, but your total bill will be $0.50 for the 50GB of bandwidth used. (You can serve a million hits, ~2TB, for $20.)

Of course, most sites will only receive a fraction of this traffic.

It’s possible to host dozens of low-traffic sites for a $1/monthly minimum bill.



<a href

Leave a Comment