Caching Best Practices
summary
Claims concrete wins: opcode caches give 10x to 100x speedups; APC/OPcache and memcached (memcached D) are compared; APC stores parsed PHP objects in-process while Memcached shares across webheads with serialization and features like append/prepend, async get and check‑and‑set to reduce contention. Examples: Digg reduces average DB calls to ~2.4 per user by caching many small reusable chunks, Facebook pre‑generates caches before rolling servers, and time‑based (5min) vs update/invalidations vs automatic write-through caching trade correctness for freshness while avoiding cache hammering.
AI-written summary · about
chapters (21)
- 0:00Intro
- 2:42But my Data Changes!
- 5:15Opcode Cache Options
- 6:53Caching Methodologies
- 18:19Cache Invalidation Strategy update invalidation
- 24:01Common Cache Solutions
- 27:58APC Common Functions
- 29:11APC Example
- 31:58Memcached Libraries
- 32:51Configuring Memcached
- 34:58Managing Memcached
- 36:43Simple Example
- 37:40Manipulating Key Values
- 40:14Read Through Cache Callback
- 41:45Check and Set Operations
- 42:34Asynchronous Fetching
- 44:53Database Caching Example
- 45:54More Generic Example
- 47:13Concept: Multi-Layer Cache
- 51:22Biggest-Smallest Reusable
- 54:03Questions?
related talks
45mUsing and (slightly) abusing APCu cache in high load concurrent environments
18mCakePHP cache engine analysis
01h 02mSpeeding up the Web with PHP 7
43mCache Me Outside - Caching Methodologies & Architectures
39mPHP Performance Demystified - Measure, Understand, Optimise
42mCaching for Cash
56mPHP OPCache, Realpath Cache and Preloading
34mCaching in Drupal 8 has evolved: Tips on how to improve your code
