TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Returns a response that clients may cache for the given number of seconds

GEThttps://api.testingapis.com/api/cache/max-age/{seconds}Sign in to see this endpoint's URL

Sets Cache-Control: public, max-age=N and Expires. A caching client reuses the same generatedAt until it expires.

Parameters 1

NameTypeDescription
secondsrequiredpath · integer (int32)Cache lifetime, clamped to 0-31536000 (one year).

Responses

200
Body with the generation timestamp.

Example

Request
curl -X GET "https://api.testingapis.com/api/cache/max-age/60" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
Cache-Control: public, max-age=60

{
  "maxAge": 60,
  "generatedAt": "2026-09-30T18:26:36.883Z",
  "hint": "A caching client should reuse this response (same generatedAt) until it expires."
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.