Cache Control Headers
Simulate origin server responses with configurable cache-control and HTTP headers.
/utilities/cache-control-headers/
📋 Description
Accepts query string parameters and returns a response with those parameters set as HTTP headers. Without parameters, redirects to this documentation page.
🔧 Supported Parameters
-
status
HTTP response status code (200-499, defaults to 200) -
surrogate-control
Surrogate-Control header value -
cache-control
Cache-Control header (supports multiple directives) -
Expires
Expires header (must be "0" or valid HTTP date format) -
set-cookie
Set-Cookie header (can be specified multiple times) -
Location
Location header
💡 Examples
Multiple cache-control directives:
/utilities/cache-control-headers/?cache-control=no-store,%20max-age=0
Surrogate-control:
/utilities/cache-control-headers/?surrogate-control=max-age=3600
Multiple cookies:
/utilities/cache-control-headers/?set-cookie=session=abc&set-cookie=user=john
Combined parameters:
/utilities/cache-control-headers/?cache-control=max-age=7200&surrogate-control=max-age=3600
📄 Response Format
{
"message": "Cache control headers test endpoint",
"status": 200,
"headers_set": {
"Cache-Control": "max-age=3600",
"Surrogate-Control": "max-age=7200"
}
}
Important Notes
- Without query parameters, redirects (302) to this page
- Status accepts 200-499 (defaults to 200)
- Invalid status codes return 400 Bad Request
- Expires must be "0" or valid HTTP date format
- Multiple set-cookie parameters supported