Caching Demo
Test different cache TTLs for various asset types. See how the CDN caches different resources with different expiration times.
Caching Strategy
/assets/images/* - TTL: 1 year
/assets/fonts/* - TTL: 30 days
/assets/css/* - TTL: 1 day
/assets/js/* - TTL: 1 day
/api/* - TTL: 5 minutes
/secure/* - No cache
Test Asset Types
Click the test buttons below to fetch different asset types and see their cache behavior. The timestamp shows when the content was generated on the origin server.
Static Image (1 year TTL)
GET /assets/images/logo.svg
Static images are cached for 1 year with immutable cache control.
No request sent yet. Click the "Test" button above to test this endpoint.
Font File (30 days TTL)
GET /assets/fonts/inter-regular.woff2
Font files are cached for 30 days with immutable cache control.
No request sent yet. Click the "Test" button above to test this endpoint.
Stylesheet (1 day TTL)
GET /assets/css/main.css
CSS files are cached for 1 day with must-revalidate.
No request sent yet. Click the "Test" button above to test this endpoint.
JavaScript (1 day TTL)
GET /assets/js/main.js
JavaScript files are cached for 1 day with must-revalidate.
No request sent yet. Click the "Test" button above to test this endpoint.
API Endpoint (5 minutes TTL)
GET /api/demo-data
API endpoints are cached for 5 minutes. Check the timestamp to see if the response is from cache or origin.
No request sent yet. Click the "Test" button above to test this endpoint.
Protected Content (No cache)
GET /secure/api/data
Protected endpoints have no cache and always fetch from origin.
No request sent yet. Click the "Test" button above to test this endpoint.
Testing Instructions
- Click the test buttons above to fetch different asset types
- Check the response headers to see Cache-Control values
- For API endpoints, compare the timestamp with the current time to determine if the response is from cache
- Make multiple requests to the same endpoint to see caching behavior
- Protected endpoints should always return fresh data (no cache)