Data Driven Cache Invalidation
summary
Shows how to invalidate HTTP caches from the database by sending Varnish purge requests from Postgres. Uses triggers + PL/Python for a simple synchronous purge (blocking, brittle across multiple writers), then replaces it with an async pipeline: insert events into pgq (SkyTools), run a consumer that calls Varnish admin to purge URLs, and optionally tag cached responses with custom headers. Explains tradeoffs, performance, retry behavior and when per-URL vs broader purges make sense.
AI-written summary · about
chapters (7)
- 0:00Introduction and architecture
- 4:16Application demo setup
- 10:48Adding varnish and caching
- 16:32Data-driven invalidation
- 20:55Trigger-based purging
- 28:13Asynchronous queueing with PGQ
- 42:54Advanced strategies and Q&A
related talks
58mCaching the uncacheable: delivering personalized experiences without sacrificing performance
28mCaching the uncacheable in Varnish
37mVarnish tips & tricks
42mCaching for Cash
46mVarnish for PHP developers
38mThe power of cache in a slow world
27mCaching for Cash
01h 00mDrupal 8 Caching: A Developer’s Guide
