Image Caching Test
The Image Caching Test inspects the Cache-Control headers on every image referenced by a URL and reports whether each is cacheable, for how long, and whether the cache strategy matches the asset's update cadence. Images rarely change once published — yet many sites cache them for only an hour or fail to cache them at all, forcing repeat downloads of multi-megabyte hero images on every visit.
What This Tool Checks
- Cache-Control header on every image
- max-age value per image
- immutable directive on hashed image URLs
- CDN cache hit / miss for images
- ETag and Last-Modified headers
- Vary headers preventing image caching
Why It Matters for SEO
Images are typically 50-70% of page bytes. Cached images cost zero bytes on repeat visits — but only if the cache policy is correct. Many CMSes ship images with no Cache-Control header, defaulting to short browser-driven heuristics. Setting a long max-age on image URLs is a one-line CDN config change that often shaves seconds off repeat-visit load times.
How to Fix It
Set Cache-Control: public, max-age=2592000 (30 days) on all image responses. Add immutable on URLs that include a content hash. If you content-negotiate WebP / AVIF, include Vary: Accept. Configure your CDN with a TTL at least as long as the browser max-age.
How It Works
We walk every image referenced on the page (img src, picture source, CSS background-image), make a HEAD request to each, and capture the cache-related headers. Each image is rated for cacheability and the savings from improving its policy are estimated.
Common Mistakes to Avoid
- Images with no Cache-Control header at all
- Short max-age (hours instead of weeks/months)
- Hashed image URLs without immutable
- Missing Vary: Accept blocks WebP / AVIF negotiation
- CDN cache TTL shorter than browser max-age
Quick Checklist
- All images return Cache-Control: public, max-age=2592000+
- Hashed URLs include immutable
- CDN cache hit on repeat requests
- Vary: Accept set when content-negotiating WebP/AVIF
- ETag or Last-Modified for conditional requests