Documentation
CORSPORXY Logo

Documentation → features

Dynamic Cache

CorsProxy caches responses at the edge to reduce latency and protect origin services from repeated requests.

Note: Cache is stored per data center, not globally. Users in different regions will have separate caches, which means initial requests from a new region will fetch from the origin before being cached locally.

Default Caching Behavior

CorsProxy uses two caching paths depending on the request:

  1. Tiered cache (GET/HEAD)

    • Uses Cloudflare tiered cache.
    • Default TTL: 1 hour.
    • Applies to GET/HEAD requests when caching is eligible.
  2. Cache API (POST + feature requests)

    • Used for POST requests (when cacheable), extract/convert requests, or when a TTL override is used.
    • Default TTL: 1 hour unless overridden.

TTL Overrides

You can override cache duration with the ttl parameter.

  • Format: integer seconds (e.g. 300, 3600).
  • Requires: a valid API key and a Business plan.

Example (5 minutes):

https://corsproxy.io/?url=https://example.com/data&key=YOUR_API_KEY&ttl=300

Cache Eligibility Rules

Caching is bypassed when any of the following apply:

  • Request includes Authorization or Cookie headers.
  • Response includes Set-Cookie or WWW-Authenticate headers.
  • POST content type is unsafe or unknown (e.g. application/x-www-form-urlencoded, multipart/form-data).
  • Cache is disabled for the current plan or request.

Cache Keys

Cache keys are derived from:

  • Normalized target URL
  • HTTP method
  • POST body hash (for POST cache keys)
  • API key (for Cache API entries)
  • TTL override (when provided)
  • Feature variants (extract/convert)

This keeps raw responses separate from converted or extracted outputs and isolates caches per key when required.

Cache Headers

CorsProxy includes cache-related headers in responses:

HeaderDescription
X-Cache-StatusHIT, MISS, or BYPASS
X-Cache-ReadCache API read result (hit, miss, no-caches-api, etc.)
X-Cache-WriteCache API write result (saved, put-failed, etc.)
X-Cache-SkipReason caching was skipped
X-Cache-Body-HashBody hash used for POST cache keys

Enable debug mode for extra diagnostics:

https://corsproxy.io/?url=https://example.com/data&debug=1

Debug headers include:

  • X-Cache-Path (tiered-cache, cache-api, bypass)
  • X-Cache-Key-Url
  • X-Cache-Key-Hash

Usage Examples

Default caching (1 hour):

https://corsproxy.io/?url=https://example.com/data

POST caching (cacheable content type):

https://corsproxy.io/?url=https://example.com/graphql

Custom TTL (Business plan + API key):

https://corsproxy.io/?url=https://example.com/data&key=YOUR_API_KEY&ttl=900