Tools
Cache Busting: Force Browsers & Cloudflare to Reload Assets
Last updated: 4/20/2026
Why Assets Don't Update
When you replace a file with the same name, three caches may serve the old version:
- Browser cache — Your local machine's stored copy
- Cloudflare CDN — Copies on global Cloudflare servers
- Server cache — Less common for static files
Method 1: Hard Refresh (Browser Only)
- Mac:
Cmd + Shift + R - Windows/Linux:
Ctrl + F5
Test in Private/Incognito window first — no cache is read.
Method 2: Purge Cloudflare Cache
If the asset is new on the server but Cloudflare serves the old one:
- Cloudflare dashboard → your domain
- Caching → Configuration
- Purge Everything
Method 3: Cache Busting in Code
Add a version query parameter so browsers treat it as a new file:
<!-- Gets cached indefinitely --> <img src="assets/images/banner.jpg"> <!-- Forces browser to download new version --> <img src="assets/images/banner.jpg?v=2">
In PHP, use the file modification time automatically:
$version = filemtime('assets/images/banner.jpg'); echo '<img src="assets/images/banner.jpg?v=' . $version . '">';
Method 4: Rename the File
The most reliable method ever:
hero-bg.jpg → hero-bg-v2.jpg
No cache issues possible. Update the reference in code and commit.
Method 5: Verify Server Has Latest Code
If using Coolify auto-deploy:
- Coolify → project → Deployments tab
- Confirm latest deployment completed
- If not, manually click Deploy