Back

Trifold is a tool to quickly and cheaply host static websites using a CDN

99 points3 monthsjpt.sh
Brajeshwar2 months ago

I throw everything I experiment with at Cloudflare, including my personal website and the family’s Internet stuff (websites, etc). None of them is commercial. Cloudflare tells me that it served 68.44 GB in the last 30 days, and the Invoice was ZERO.

I’ve been looking for an extra-cheap CDN, and I’m not so worried about high uptime. I’m not yet ready to cough up the cost for Cloudflare R2 and AWS CloudFront, though it’s not costly, but I’m still in that cheap-feeling phase and not ready to offload over 100GB of files to the public while paying a price.

I looked at Bunny CDN a while back, but I remember thinking that the minimum was like ~$50. What did I miss? I dismissed it as non-personal option.

portaltonowhere2 months ago

$1 minimum for Bunny CDN. https://bunny.net/pricing/

Brajeshwar2 months ago

Yeah Ha! I saw that from this article and signed up. I even did the Card Verify thingy for $30 additional Credit. Will be trying this out and also do a comparison with Cloudflare R2.

chrismorgan2 months ago

> I even did the Card Verify thingy for $30 additional Credit.

I hadn’t heard of this, only seen the “14 day free trial” thing, so I checked: the trial gives $20 of credit, and verifying a card gets you $30 more, but it’s all trial credits which expires 14 days after you create your account. In other words, completely useless for people looking to spend under the $1/month minimum.

Pity, free for 2½ years sounded good.

Brajeshwar2 months ago

Yeah! Saw that. Did some comparison and I don’t think Bunny comes in cheap at the longer run. Cancelled subscription.

miyuru2 months ago

AWS CloudFront is free up to 1TB bandwidth and 10 million HTTP/HTTPS requests per month.

https://aws.amazon.com/blogs/aws/aws-free-tier-data-transfer...

hexbin0102 months ago

That's old info. They free tier is now 100GB and 1M requests

https://aws.amazon.com/cloudfront/pricing/

miyuru2 months ago
hexbin0102 months ago

Ahh clear as mud haha. Thanks

Brajeshwar2 months ago

I’ve come past way beyond the 1st year honeymoon with AWS.

Edit:

I’m sorry but I’m today years old learning that AWS indeed is free-ish, “Data Transfer from AWS Regions to the Internet is now free for up to 100 GB of data per month (up from 1 GB per region).”

“Data Transfer from Amazon CloudFront is now free for up to 1 TB of data per month (up from 50 GB), and is no longer limited to the first 12 months after signup.”

Now, I need to figure out why am I being billed each month for some of the files I use AWS for!

anamexis2 months ago

The CloudFront free tier runs indefinitely.

KomoD2 months ago

> I’m not yet ready to cough up the cost for Cloudflare R2 and AWS CloudFront

> but I’m still in that cheap-feeling phase and not ready to offload over 100GB of files to the public while paying a price

You wouldn't pay like anything for that on Cloudflare R2. You get 10GB and $0.015/GB (so what... like a dollar or something?) for anything over + free egress.

toddmorey2 months ago

Wait I don’t get it. CF is free for your use case, but you are looking for a cheap CDN? What’s cheaper than free?

Brajeshwar2 months ago

I’ve got quite a few (very old) downloads coming to my websites, and I don’t want people to lose them. I also want to maintain a no-frills, store-and-forget thing that does not cost much. I was using AWS S3 + CloudFront for a long time, but I realized I was paying over $10 a month for something I didn’t even interact with or check often enough.

I’m OK with a sub-$10/mo budget, but Amazon Web Services doesn’t offer a way to pay recurring charges with Indian Cards. After this thread, I read up a lot yesterday and realized that Amazon AWS India is now pretty well oiled and working. I might stick to it and pay it off in advance. I’d be more than glad to, say, pay off $100 a year and not think about it.

The cost on AWS, I realize, is the S3 storage. Cloudflare is already fronting the CDN aspects of it.

So, I was looking for something with a sweet spot, say, pay something in the lines of $10 a year, at max about $25 a year, and it just dumps all of my files now and, to an extent, in the long term.

adamhartenz2 months ago

They are obviously looking for something to meet there future needs, not there current needs. It is free now, but they might be planning to one day tick over the free thresholds.

ozim2 months ago

Cloudflare transfer is inflated. I have personal website via CF that there is no way is having transfer amounts they claim there is.

blargwill2 months ago

This is the first time I've read this but have personal experience similar. A few of my single page, gone nowhere, projects are seeing ~2k views a month. They're seeing zero traffic through google in that same period so no idea where it's coming from?

0x3f2 months ago

How recently? Because a ton of my current day traffic is LLM scraper activity.

Wowfunhappy2 months ago

Interesting! Do you have any suspicions as to where Cloudflare’s numbers are coming from?

ozim2 months ago

Reading other comments I might just underestimate amount of crawlers that just scrape everything.

fatchan2 months ago

I would hope the invoice is 0 for that amount of traffic.

faizshah2 months ago

FYI if you want an s3 + CF analogue setup, b2 is integrated with bunny and allows private buckets: https://www.backblaze.com/docs/cloud-storage-integrate-bunny...

I haven’t yet worked out the best cheap VPS/dedicated provider though, project for next weekend.

0x3f2 months ago

I feel like I've tried many similar combos and there ends up being some tiny, silly, trivial thing that bothers me in the end. For example, I remember fighting with one of them that forced trailing slashes, and another that didn't allow apex domains (i.e. non-www address) for static sites.

I absolutely refuse to actually ship valuable things though so thanks for the suggestion and I'll probably spend some time trying it out.

faizshah2 months ago

I agree, for me it’s my current weekend project to try to figure out a dirt cheap and high performance self hosted cloud for hosting stuff.

So I’m still sticking with Route53 cause it’s the least annoying registrar and DNS api, for CDN I’m going with bunny and for dirt cheap object storage I’m going with b2.

Then the fun part is the actual self hosting: I’m going with Garage for my normal self hosted S3 api (b2 is for backups etc.), Scylla for DDB, Spin for super fast Wasm FaaS…

Then this weekend I got deep into trying to build my cloudwatch alternative I think I’m going with dumping logs with vector into b2 and then using quickwit for searching the logs.

Just a fun homelab challenge really.

0x3f2 months ago

> trifold offers an easy alternative to services like Cloudflare Pages, Netlify [...]

Does it? Those provide dynamic compute for e.g. SSR, not hosting static sites. The equivalent here is more like S3 + Cloudflare (Cloud Connector and some rules). Which is free for most use cases and (IMO) pretty easy.

tclancy2 months ago

Is it an easy alternative to GitHub pages? That felt pretty simple when I was looking for a solution to this exact situation. Each requires some coding knowledge, but it feels like this is a bit more work. And why do I have to pay anything?

0x3f2 months ago

I haven't used GitHub pages so I'm not actually sure if it provides compute or purely static file hosting, which is why I removed it from my quote.

Although it's my understanding that GitHub has much tighter content restrictions than the others. So you can't host commercial projects or anything the GitHub org finds 'icky'.

Tepix2 months ago

> So you can't host commercial projects or anything the GitHub org finds 'icky'.

I don't think that's accurate. What's your source?

+1
0x3f2 months ago
hollerith2 months ago

SSR == server-side rendering

bradley_taunt2 months ago

This is pretty neat, but setups like this always make me wonder how the “static web” has become so complex?

I feel that tossing your static files up on a host like NearlyFreeSpeech (or any other cheap/decent host) is the easiest.

This would also only cost you ~$0.03 a day. Don’t reinvent the wheel, you know?

0x3f2 months ago

A lot of what the newer hosts provide is making your SPA or other JS framework app 'just work' without extra config. E.g. your build generates /index.html and the host will redirect all other paths to that file.

Also, if it's about cost then whatever cloud bucket plus CDN is going to be typically free and will scale to infinity for very cheap. Everyone dreams of a random blog post being on top of HN after all.

I suppose whether that's simpler depends on if you are familiar with the cloud offerings, but many people are through {dayjob}. For me, I'd rather use similar tooling for work and personal projects, so I don't have to think too much about it.

jrm42 months ago

Hey, so, as an old-timer (who has paid for regular old hosting for almost 30 years) whats going on here?

Specifically: Is it that a whole lot of you are deploying things that require the heavy lifting of a CDN -- or is it that you're just used to the idea of one out of habit?

jazzyjackson2 months ago

It's the rock bottom prices. I converted a rails app to 140,000 prerendered static pages and uploaded to cloudflare and as long as I'm under 1 million visits a month it's free.

chanux2 months ago

Trifold looks simple! Also seems like a good reason to finally try out bunny.net

For anyone who might find this interesting, I wanted a static site knowledge base but private: https://chanux.me/blog/post/static-site-with-auth/

I host this with GCP and stay within free tier

And how I deploy a similar thing with GCS/Cloud build etc is covered here https://chanux.me/blog/post/automate-static-site-publishing-...

0x3f2 months ago

> For anyone who might find this interesting, I wanted a static site knowledge base but private: https://chanux.me/blog/post/static-site-with-auth/

This seems... incredibly complex when you could just use S3 + Cloudflare.

chanux2 months ago

I agree that the initial setup is a bit complex. And at the time of writing, I could not find anything better. But once I set it up, it's quite friction-less and low maintenance so I didn't look further.

However, if you have pointer to a better solution, appreciate a link. Always looking to simplify.

0x3f2 months ago

Not saying you should change it if it's working, and I don't have a ready-made tutorial, but assuming you only need to serve static files I would:

  (1) upload the files to an S3 bucket (GCS or Cloudflare R2 may also work, haven't tried);
  (2) point Cloudflare at the bucket via their Cloud Connector;
  (3) turn on Cloudflare Access.
pwdisswordfishs2 months ago

[dead]

CrimsonCape2 months ago

Can someone ELI5 from the experience of hosting a static site, what is the next step beyond a static CDN?

I am guessing the next step is paying for a bucket that that allows virtualized containers to run an OS? Or having a constantly-up node.js backend to generate server-side HTML? Is this essentially the generic description of self-hosting Wordpress on an own server?

Does integrating a payment processor like Shopify require something more than static hosting?

benmanns2 months ago

For Shopify in particular, they have a headless front-end services called Hydrogen[0] (with optional hosting called Oxygen). It's basically an opinionated wrapper around the storefront[1] and customer account[2] APIs, which allows interacting with the store from the front-end. It allows you to host Shopify on your own domain under your own control and gives a bit more customization than is available via hosted Shopify. It's what I run for the Creature Publishing site[3] and allows some extra customization for wholesale accounts, etc, without the exceptionally expensive enterprise (Shopify Plus) plan. To be completely honest, sometimes I question the decision over a simple hosted shop subdomain. Some light SSR/API calls are necessary for our setup, which is hosted on Cloudflare Pages/Workers.

[0]: https://hydrogen.shopify.dev/

[1]: https://shopify.dev/docs/api/storefront/latest

[2]: https://shopify.dev/docs/api/customer/latest

[3]: https://creaturehorror.com/

0x3f2 months ago

Next step in which dimension?

There is what modern JS world calls 'SSR' (server-side rendering) which is where, yes, you basically have a node server running to generate the HTML that is sent to the browser and that's then 'hydrated' into a client-side app. Doesn't necessarily have to be Node/JS though, other languages have their own frameworks, but JS is probably most common. This setup can then be fronted by a CDN for caching purposes.

That's not really related to the bucket concept though, it just runs on a normal server and serves everything (static and dynamic content), typically.

IMO the benefits of SSR (vs SSG or a pure static-file site) are marginal _unless_ you have a very specific use case. E.g. an ecommerce site where you want all your product pages to have great SEO, but you've got too many products to build them all at once.

Then again if you _only_ need a website (i.e. no API for other clients) then it can be nice to have end-to-end types in that kind of fullstack setup.

> Does integrating a payment processor like Shopify require something more than static hosting?

I don't know about Shopify but for e.g. Stripe you can do a lot on their hosted pages, without your own backend. If you want to automate things though, have user state based on payments, etc you will need a backend and a data store of some kind. But that could be an API that your static site points to.

jadbox2 months ago

Does it work with Astro?

e12e2 months ago

Reminder that neocities have a free tier (and an optional payed tier) - and comes with its own CDN.

https://neocities.org