Edge Caching Dynamic Rails Apps
summary
Explains how to put Rails fragments at CDN edges using surrogate-key header binding and purge-by-key, uses pull CDNs (reverse-proxy edges) with s-maxage / Surrogate-Control and cache-control for browser vs edge lifetimes, and keeps origin connections warm with TCP keep-alive (DSA) so cache misses are faster. Describes a working stack (Varnish-based Fastly), a fast global purge implementation under 300 ms, and a fastly_rails gem that sets headers and issues purges from model callbacks.
AI-written summary · about
chapters (20)
- 0:00Intro
- 1:10Agenda
- 2:13Terminology
- 4:38Content Delivery Networks
- 6:22Static Content
- 7:33Push CDNs
- 9:01Reverse Proxy
- 11:32MaxAge
- 12:03Private
- 13:30Example
- 14:33TCP
- 15:42Keepalive
- 16:40Instant Purge
- 18:33Dynamic Content
- 20:10Dynamic Content Example
- 22:54Creating Cache Keys
- 23:58Cache Control Headers
- 24:41Index and Show
- 25:15Purge Instance Methods
- 26:25Wrap Up








