We Architected an Edge Caching Layer to Eliminate Cold Starts
Key topics
As developers debated the intricacies of eliminating cold starts with edge caching, a lively discussion unfolded around the trade-offs between complexity and performance. Some commenters, like 0x3f, pointed out that a simple CDN with 'stale-while-revalidate' headers could achieve similar results, while others, like cloudflare728, shared their experiences implementing this technique with HAProxy. The author, skeptrune, clarified that their approach was chosen for its relative ease and resource efficiency compared to migrating to a static site architecture. Amidst the discussion, a consensus emerged that frameworks like NextJS can sometimes lead to over-engineering, with 9rx quipping that Vercel's optimizations can make things "10 times harder than it needs to be."
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
4h
Peak period
15
4-6h
Avg / period
4.1
Based on 29 loaded comments
Key moments
- 01Story posted
Dec 15, 2025 at 11:08 AM EST
18 days ago
Step 01 - 02First comment
Dec 15, 2025 at 3:02 PM EST
4h after posting
Step 02 - 03Peak activity
15 comments in 4-6h
Hottest window of the conversation
Step 03 - 04Latest activity
Dec 16, 2025 at 11:46 AM EST
17 days ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
The build logic to decide which things to rebuild of course is probably the interesting bits but we dont need all these services... </grey-beard-rant>
[1] https://openbenchmarking.org/test/pts/nginx&eval=c18b8feaeca...
I already had HAProxy setup. So I have added stale while revalidate compatible header from HAProxy. Cloudflare handle the rest.
Now that I have proper header added by HAProxy, Cloudflare cache rules for stale-while-revalidate works.
I obviously can be done but clearly is not the intended solution which really bothers me
I have come to conclude it is that way because they focus on optimizing for a demo case that presents well to non-technical stakeholders. Doing one particular thing that looks good at a glance gets the buy-in, and then those who bought in never have to deal with the consequences of the decision once it is time to build something other than the demo.
However, it's probably more inexperience than anything. Nobody senior was around to tell our founders that they should go for a SSG architecture when they started /shrug. It's mostly worked out anyways though haha.
How do you do version updates? Add content hash to all files except for root index.html.
Cache everything forever, except for index.html
To deploy new version upload all files, making sure index.html is last.
Since all files are unique, old version continues to be served.
No cache invalidating required since all files have unique paths, expect index.html which was never cached.
You have to ensure you absolutely have properly content hashes for everything. Images, css, js. Everything