carlosuhart/seo-audit-skills/cache-headers
Claude Code and agent skill by carlosuhart/seo-audit-skills
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Cache architecture for SEO: Cache-Control, CDN vs browser cache, ETag and Last-Modified, and CMS setups (WP Rocket, LiteSpeed, PrestaShop, Nginx/Apache). Use for TTFB issues, caching layers or cache header audits.
Install
npx vskill@latest install carlosuhart/seo-audit-skills/cache-headersSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as carlosuhart/seo-audit-skills/cache-headers.
Cache Headers & Caching Strategy — Technical SEO
Correct caching is the single highest-ROI performance optimization for mostsites. A cold origin TTFB of 800ms becomes < 50ms with a CDN cache hit.
Cache-Control directives reference
| Directive | Meaning | Use case | |
|---|---|---|---|
max-age=N | Browser can cache for N seconds | Static assets | |
s-maxage=N | CDN/shared cache can cache for N seconds | CDN-specific TTL | |
no-cache | Must revalidate with server before using cache | HTML pages | |
no-store | Do not cache at all | Authenticated/transactional pages | |
must-revalidate | Once stale, must revalidate (do not serve stale) | HTML pages | |
public | Shared caches (CDN) can store this response | Static assets, HTML | |
private | Only browser cache, not CDN | Logged-in user pages | |
immutable | Content will not change — no revalidation needed | Versioned static assets | |
stale-while-revalidate=N | Serve stale while fetching fresh in background | HTML for fast TTFB |
Combinations by content type
Cache layers architecture
Each layer reduces load on the next. A CDN hit eliminates all layers below it. A page cache hit eliminates the PHP and database layers.
ETag and Last-Modified
Both are validation mechanisms — they allow a client with a cached response to ask "has this changed?" without downloading the full response again.
Last-Modified:
ETag:
SEO relevance: ETags and Last-Modified enable Googlebot to efficiently re-crawl pages — if the content has not changed, Googlebot receives 304 and skips re-processing. This conserves crawl budget on large sites.
When ETags are a problem: Nginx and Apache can generate ETags that include inode numbers. On multi-server setups, different servers generate different ETags for the same file → cache validation fails → unnecessary full responses.
Fix for Nginx:
WordPress caching
Page cache — plugin options
| Plugin | Mechanism | Recommended stack | |
|---|---|---|---|
| WP Rocket | File-based page cache | Nginx or Apache + LiteSpeed | |
| LiteSpeed Cache | LiteSpeed server-native | Hostinger, LiteSpeed servers | |
| W3 Total Cache | Multiple backends | VPS with Redis/Memcached | |
| WP Super Cache | File-based | Basic shared hosting |
WP Rocket configuration
Page Cache:
- Settings > Cache > Enable caching for mobile devices: on
- Separate cache for mobile: on (if theme is responsive, keep off)
- Cache lifespan: 10 hours (adjust to content update frequency)
Browser cache:
- Settings > Browser Caching > on
- WP Rocket handles Cache-Control headers for static assets
CDN integration:
- Settings > CDN > CDN hostname: your CDN URL
- This rewrites asset URLs to the CDN hostname
Exclusions (important for e-commerce):
LiteSpeed Cache
Common misconfiguration — X-Robots-Tag on XML files: LiteSpeed may apply X-Robots-Tag: noindex to all XML responses including sitemaps. Fix: LiteSpeed Cache > Advanced > Excludes > Do Not Cache URIs > /sitemap*.xml
Cache purge on publish: LiteSpeed Cache automatically purges page cache when a post is published or updated. Verify this is working: publish a post and check the response headers for the page — X-LiteSpeed-Cache: miss confirms a fresh request was served.
Separate mobile cache — WP Customizer CSS stripped: LiteSpeed Cache can maintain separate cached versions for desktop and mobile (detected by User-Agent). When CSS is added via WP Customizer (Additional CSS), LiteSpeed's CSS optimization strips the <style id="wp-custom-css"> block when building the mobile cache. Result: CSS works for logged-in admins (who bypass cache) and in DevTools mobile simulation (which uses the desktop cache), but not on real mobile devices.
Diagnosis:
Fix — use Code Snippets plugin (scope site-css) instead of WP Customizer: Code Snippets generates a dedicated external stylesheet (?code-snippets-css=1) that LiteSpeed includes correctly in the HTML for all devices. The WP Customizer inline <style> block is unreliable with LiteSpeed CSS optimization enabled.
Note: WP Admin may be blocked by Cloudflare for scripted requests. In that case the cache purge must be triggered manually from the WordPress dashboard.
Redis object cache
Object cache stores database query results in memory. Eliminates repeated identical queries to MySQL.
Object cache reduces TTFB on pages with complex WP_Query calls (WooCommerce shop, custom post type archives, widgets pulling recent posts).
PrestaShop caching
CCC (Combine, Compress, Cache)
Path: Advanced Parameters > Performance > CCC
| Option | Effect | Recommended | |
|---|---|---|---|
| Smart cache for CSS | Combines and compresses CSS | On | |
| Smart cache for JavaScript | Combines and compresses JS | On | |
| Minify HTML | Removes whitespace from HTML | On | |
| Compress inline JavaScript | Minifies inline JS | On | |
| Move JavaScript to end | Defers JS to before </body> | On |
Warning: CCC can break custom themes. Test on staging first.
Smarty cache
Path: Advanced Parameters > Performance > Smarty
| Setting | Production value | |
|---|---|---|
| Cache compilation | Never recompile template files | |
| Cache | Enabled | |
| Caching type | File system |
Full-page cache for PrestaShop
PrestaShop does not include a built-in full-page cache. Options:
- Varnish in front of the application server — caches full HTML responses
- Nginx FastCGI cache — caches PHP-FPM responses at the web server level
- Third-party module — available on PrestaShop Addons marketplace
Configure cache bypass for:
/order/(checkout)/cart/- Any URL with
PHPSESSIDcookie set
Nginx caching configuration
FastCGI page cache
Static asset cache headers
CDN caching
What CDNs cache by default
Most CDNs (Cloudflare, Fastly, CloudFront) cache:
- CSS, JS, images, fonts — yes, by default
- HTML — no, not by default (treated as dynamic)
To cache HTML, you must configure a cache rule:
Cloudflare — cache HTML with short TTL:
Effect: TTFB drops from 400-800ms (origin) to 10-50ms (CDN edge).
Cache invalidation
When you publish new content, the CDN must serve the new version. Options:
- Short TTL (1h): cache expires automatically. Simple but means stale content
for up to 1 hour after a change.
- Cache purge on publish: WordPress plugins (WP Rocket, LiteSpeed) can purge
the CDN cache for specific URLs when content is updated.
- Cache-Control: stale-while-revalidate: serve stale while fetching fresh
in background — best user experience.
Moving a site to a CDN — the crawl spike and the bot wall
Google published guidance on this on 11/11/2026 (https://developers.google.com/search/blog/2026/11/crawling-cdn, read 20/11/2026). Two failures show up in audits after a CDN migration:
1. Origin overloaded right after the switch. "Caches only shield you on the second visit": with cold caches, every Googlebot request is a miss that reaches the origin, and crawling often rises after an infrastructure change. Google's recommendations:
- Pre-warm the cache before cutting over: request the high-traffic URLs, the ones
expected to peak, and the most crawled ones through the CDN "at a controlled pace". The most crawled URLs come from the server logs (see the seo-logs skill).
- Temporary brake: answer
429or503for "a few hours, or 1-2 days at most". Longer
is outside what Google recommends for this brake. Never 403.
2. Googlebot blocked by the CDN's bot protection. Bot fight modes, challenge pages and "block all automated clients" rules stop verified crawlers too. Google's rule: "If you need to block bots, allow verified bots in your CDN and firewall settings" and "exempt verified crawlers from bot challenges". Target specific unwanted bots in robots.txt or with rules, instead of blocking all automation. Verify Google's IPs with https://developers.google.com/crawling/docs/crawlers-fetchers/verify-google-requests.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cache-headers/SKILL.md
Popularity
- Repository stars
- 5
- Repository forks
- 1
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/carlosuhart/seo-audit-skills/cache-headers)