Validates cache headers for optimal web performance
A comprehensive cache validation checker that analyzes cache headers for different types of web resources according to industry best practices. It validates cache configuration for HTML pages, static assets, and API responses, with platform-specific logic for Liferay environments.
The Cache Checker analyzes HTTP cache headers across different types of web resources to ensure optimal caching strategies:
HTML Pages: Validates that HTML responses have appropriate cache directives (max-age=0, must-revalidate, or no-cache) with proper validators (ETag/Last-Modified)
Versioned Static Assets: Ensures versioned resources (JS, CSS, images with version parameters) have long-term caching (max-age ≥ 1 year) with immutable directive
Unversioned Static Assets: Checks that unversioned resources use short cache times (≤ 1 hour) or revalidation mechanisms
API Responses: Validates API endpoints have appropriate cache strategies with proper validators
Platform-Specific Logic: Automatically routes to Liferay-specific cache validation when Liferay is detected in the software stack
The checker examines Cache-Control, ETag, Last-Modified, Set-Cookie, Vary, and Expires headers to identify caching issues.
| Status | Description | Test Logic |
|---|---|---|
| SUCCESS | All resources have proper cache configuration according to best practices | - HTML: Cache-Control max-age=0 with must-revalidate/no-cache and has ETag/Last-Modified - Versioned assets: public, max-age≥31536000, immutable, no cookies - Unversioned assets: max-age≤3600 or uses revalidation - No Set-Cookie on cacheable responses - No problematic Vary headers |
| WARNING | Some resources have cache configuration issues that should be addressed | - HTML cached >5 minutes without must-revalidate/no-cache - Versioned assets lack immutable or have max-age <1 year - Unversioned assets cached ≥1 day - Missing ETag/Last-Modified on resources expected to revalidate - Excessive Vary headers (>3) that may hurt cache hit rate - Expires vs Cache-Control mismatch |
| FAIL | Critical cache configuration problems that prevent effective caching | - Set-Cookie header present on publicly cacheable resources - Vary: * preventing effective caching - User-specific Vary headers on HTML resources - HTML cached >1 day without revalidation - Contradictory cache directives that disable safe caching - Missing Cache-Control header entirely |
Performance Degradation:
Poor cache configuration leads to unnecessary server requests and bandwidth usage
Users experience slower page load times due to repeated downloads of unchanged resources
Increased server load and hosting costs from redundant resource serving
SEO and User Experience Impact:
Slow loading pages negatively affect search engine rankings
Poor user experience leads to higher bounce rates and reduced conversions
Mobile users on slow connections are particularly affected
Security and Privacy Concerns:
Set-Cookie headers on cacheable resources can expose sensitive user data
Improper Vary headers may cache user-specific content inappropriately
Long-lived HTML caching without revalidation can serve stale or sensitive content
Operational Issues:
Difficult to deploy updates when resources are cached too aggressively
Inconsistent cache behavior across different browsers and CDNs
Debugging becomes complex when cache issues mask other problems
Add this checker to your monitoring setup and start identifying issues on your websites today.