You changed the file and the site did not change: counting the layers in front of it

Chris Worner

Well-known member
Registered
Joined
Apr 15, 2016
Messages
630
Points
28
Spent an hour last week convinced a deploy had not gone out, when the file on disk had been correct the whole time. Four separate things were holding the old version and each one cleared differently.

OPcache is the first and the one that catches people, because it fails silently. With validate_timestamps off in production, PHP keeps serving the compiled copy of the old file until the process restarts or you clear it on purpose. Nothing in the site tells you that is what is happening.

Then whatever the application caches itself. On WordPress that can be a page cache plugin writing static HTML, an object cache in Redis, and a separate CSS cache if a page builder is in play. Three different clear buttons, and clearing one does not touch the other two.

Last is the CDN, and that is the one that makes you doubt your own eyes, because someone on another connection sees the new version while your nearest edge keeps handing you the old one. I settle it now by requesting the page on the server itself over 127.0.0.1 with the Host header set. If that comes back new, everything from the application down is fine and the problem is purely edge.

Order matters on the way out: innermost first, or you refill the outer cache from a stale inner one and get to do the whole thing twice. Has anyone automated this across a mixed fleet, or is it still a per-stack script for everyone?
 

radwebhosting

Well-known member
Hosting Provider
Registered
Joined
Jan 14, 2016
Messages
322
Points
28
Frustrating. Definitely best to clear all caches after making file changes.
 

TheCompWiz

Well-known member
Registered
Joined
Apr 20, 2016
Messages
140
Points
18
Has anyone automated this across a mixed fleet, or is it still a per-stack script for everyone?
Still per stack here, but what made it manageable was standardising the interface instead of the implementation. Every host gets a script at the same path, with the same name, taking the same argument, and whatever happens inside is specific to that stack. The fleet tool then only needs to know that one command exists, not what any given site is built on.

The step I would add to your order is a check at the end rather than trusting the clear. Put a build marker in the output, a comment holding a hash of the deploy will do, then request over 127.0.0.1 with the Host header, then request the public URL, and compare the two. Loopback showing new while the public one shows old tells you it is edge before you go hunting through a CDN dashboard. That comparison has caught a plugin whose clear button quietly did nothing more than once.
 
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top