Back to articles
Why Purging Nginx Cache Is Only Half the Job (And How I Built the Other Half)
How-ToDevOps

Why Purging Nginx Cache Is Only Half the Job (And How I Built the Other Half)

via Dev.toHasan Γ‡ALIŞIR

If you're self-hosting WordPress behind Nginx with caching, you've probably relied on plugins to automatically purge your cache. πŸ“ Post updated β†’ πŸ—‘ cache wiped β†’ βœ… done. Except it's not done. The cache is now cold . The next visitor hits your server with a full uncached PHP + DB round trip and pays the latency penalty β€” the exact problem caching was supposed to solve. Most Nginx cache plugins only purge β€” they leave the cache cold. I wanted something that could fix that β€” which eventually led me to build NPP (Nginx Cache Purge Preload), a plugin that preloads your Nginx cache so visitors always hit a cached page. But before we get to NPP, here’s the problem that almost every WordPress + Nginx setup silently suffers from. The Problem No One Was Solving When I set up Nginx caching on my WordPress sites, the workflow looked like this: Publish or update a post Plugin purges the relevant cache entries First real visitor triggers a full PHP + DB round trip to rebuild the cache Everyone after

Continue reading on Dev.to

Opens in a new tab

Read Full Article
6 views

Related Articles