[IDEA] Use cloudflare to cache and save on bandwidth
See original GitHub issueSo this is not a real issue but just an idea.
I see that today, loading badgen.net
takes 144 KB of bandwidth, and it will become bigger every time new badges are added.
As you said on your comment, the bandwidth usage is already pretty high, and I guess the index page is a big part of it. Also, the response time on uptime robot is now > 500ms, which is a lot more than a few weeks ago.
Maybe you could use the free plan of Cloudflare to cache live badges for a few minutes, and static badges for a whole week! Docs and index could also be cached for a few minutes It could even prevent occasional downtime
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Reduce origin load, save on cloud egress fees, and maximize ...
Cache Reserve helps users serve content from Cloudflare's cache for ... These fees, known as “bandwidth” or “egress” fees, are familiar ...
Read more >The way you handle bandwidth over-usage - #34 by Judge
The bandwidth you save depends on your traffic and the size of your site. You could have TBs of data used with enough...
Read more >How can using a CDN reduce bandwidth costs? | Cloudflare
How can using a CDN reduce bandwidth costs? By caching content and making multiple round trips to the origin server unnecessary, CDNs cut...
Read more >What is caching? | How is a website cached? - Cloudflare
Caching is storing copies of files in a cache so that cached content can be accessed quickly. Learn more about CDN caches, DNS...
Read more >CDN performance | Cloudflare
A CDN improves the latency by pulling static content files from the origin server into the distributed CDN network in a process called...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I assume the total bandwidth usage (in Zeit’s dashboard) is already include cached responses.
Currently live badge are cached 3~4 minutes, static badge are cached 1 year, docs pages are cached 1 day, by Now CDN (Cloudflare). Plus 60 seconds cache on user’s browser.
Here’s scale rules for badgen.net, I never saw it spin up a second instance in sfo1 or bru1, so the server load should be fine (by now):
But I’m not sure why response time rise from ~300ms to ~500ms recently 🤔
Now CDN is really a helpful & important cache layer for Badgen Service, glad we have it since the beginning. 💪