<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caching on Everyone Has a Story</title><link>https://bhaveshsgupta.com/tags/caching/</link><description>Recent content in Caching on Everyone Has a Story</description><generator>Hugo</generator><language>en-us</language><managingEditor>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</managingEditor><webMaster>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</webMaster><lastBuildDate>Tue, 06 Oct 2026 18:26:36 +0530</lastBuildDate><atom:link href="https://bhaveshsgupta.com/tags/caching/index.xml" rel="self" type="application/rss+xml"/><item><title>Putting a live HLS origin behind a CDN</title><link>https://bhaveshsgupta.com/blog/hls-cdn-2-live-origin-behind-a-cdn/</link><pubDate>Tue, 06 Oct 2026 09:01:00 +0530</pubDate><author>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</author><guid>https://bhaveshsgupta.com/blog/hls-cdn-2-live-origin-behind-a-cdn/</guid><description>&lt;p&gt;A CDN in front of a live HLS origin should mean each segment leaves your server a handful of times, however many people watch. Whether it does depends on details that are easy to get wrong and hard to see: the URLs your origin hands out, the headers on each kind of file, and every layer between the origin and the viewer that has its own opinion about caching.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; A CDN only protects a live origin if every viewer requests the same URLs: no per-viewer session ids, and no query strings in the cache key. Give media playlists about a one-second lifetime, segments about a minute, and errors no-store so an early 404 isn&amp;rsquo;t served to everyone. Check headers at every hop, send CORS headers when the player is on another domain, and confirm request collapsing and an origin shield with the CDN that pulls from you.&lt;/p&gt;</description></item></channel></rss>