Trifold 是一种使用 CDN 快速且廉价地托管静态网站的工具。
Trifold is a tool to quickly and cheaply host static websites using a CDN

原始链接: https://www.jpt.sh/projects/trifold/

## Trifold:简单、经济实惠的静态网站托管 Trifold 是一款命令行工具,旨在轻松部署静态网站(HTML、CSS、JS、图片),使用内容分发网络 (CDN)。它是一种经济高效的 Netlify 和 GitHub Pages 等服务的替代方案,旨在通过合理定价的付费服务实现稳定性。 Trifold 简化了诸如项目初始化、将文件同步到 CDN、配置带有 SSL 的自定义域名以及设置每月支出限制等任务。目前,它支持 bunny.net,这是一种 CDN,提供每月 0.01 美元/GB 的存储和带宽 – 即使流量很大,也使其非常经济实惠。 Trifold 的构建源于独立开发者和学生对可靠托管解决方案的需求,优先考虑易用性和可预测的成本。安装通过 `uvx trifold` 或标准 Python 包管理器简化。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Trifold 是一个工具,可以快速且廉价地使用 CDN 托管静态网站 (jpt.sh) 6 分,birdculture 发表于 2 小时前 | 隐藏 | 过去 | 收藏 | 讨论 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

trifold is a tool to serve static websites using a content delivery network (CDN).

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

This allows painless deployment of sites consisting entirely of static assets (HTML, CSS, JS, images) for pennies a month. It is the perfect companion to deploy sites built with static-site generators like Hugo, Zola, Quarto, or zensical.

The tool provides a simple CLI that allows:

  • initializing new projects without touching the CDN web interface
  • syncing local HTML/CSS/JS/etc. to the CDN & clearing the cache
  • configuring a custom domain name to point at your files, with SSL enabled
  • setting a maximum monthly cost to avoid surprise bills
  • using CDN edge functions to support redirects

This project grew out of frustration with services making their free tier less friendly to indie devs and students that just need a cheap & reliable place they can host things. trifold offers an easy alternative to services like Cloudflare Pages, Netlify, and GitHub pages.

Instead of relying on a free service it is hopefully going to be more stable to rely on a paid service with a reasonable price point and the ability to set billing limits.

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 curious to learn more.)

To upgrade: uv tool upgrade trifold

You can also use any Python package manager you prefer, pip, pipx, poetry, etc. to install in your preferred manner.

bunny.net & pricing

At the moment 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 & bandwidth. Both starts at $0.01/GB/mo.

The typical static webpage is under 1GB, meaning storage costs will be negligible unless you decide to host audio/video. And if you do, the rates are far cheaper than most competitors, see their pricing for details.

In terms of bandwidth, let's say your page size is 2MB (a moderate-sized page) and hits the front page of a popular website, driving a surge of 25,000 hits. (Congrats!)

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

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

It is possible to host dozens of low-traffic sites for the $1/monthly minimum bill.

联系我们 contact @ memedata.com