Back to HTTP Headers
Both

HTTP Cache-Control Header

Specifies caching directives for both requests and responses. Controls how and for how long content is cached by browsers and intermediate caches.

Purpose

Optimizes performance by controlling caching behavior, reducing redundant requests and server load.

Cache-Control: no-cache Cache-Control: no-store Cache-Control: max-age=3600 Cache-Control: public, max-age=86400 Cache-Control: private, must-revalidate

Code Examples

See how to use the Cache-Control header in different tools and languages.

curl -I -H "Cache-Control: no-cache" https://api.example.com/resource
curl -I https://api.example.com/resource
# Check Cache-Control header in response

Related Headers

Test Your APIs

cache-control headerhttp cache-controlhttp headers guide