ZapKit

HTTP headers reference

Find out what an HTTP header does and where it's sent, from Cache-Control and Set-Cookie to the CORS and security headers.

What are HTTP headers?

HTTP headers are name and value pairs sent with every web request and response, carrying information beyond the content itself: what formats are accepted, how long to cache, who is logged in, which sites may read the data, and how the browser should protect the page.

This reference explains about fifty of the most useful headers in plain words and marks whether each is sent by the client, the server or both. Search by name or topic, filter by direction, and copy a header's exact name.

How to use the HTTP headers reference

  1. 1.Search

    A header name, or a topic like cache, cors or cookie.

  2. 2.Filter

    Request, response, or both.

  3. 3.Copy

    Copy the exact header name.

Example: caching a logo for a year

Headers for a versioned image file:

Cache-Control
public, max-age=31536000, immutable
ETag
"a1b2c3" for cheap revalidation
Content-Type
image/svg+xml

Browsers keep the file for a year and never re-download it.

Headers that matter most

Caching is controlled by Cache-Control, with ETag and Last-Modified enabling cheap 304 responses. Cookies are set with Set-Cookie, where HttpOnly, Secure and SameSite protect them. CORS headers starting Access-Control- decide which other websites may read a response.

Security headers such as Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options and Referrer-Policy defend against cross-site scripting, downgrade attacks and leaks. Header names aren't case-sensitive, so cache-control and Cache-Control are the same header. HTTP/2 and HTTP/3 send them in lowercase, which is why developer tools often show them that way. A few headers, such as Connection and Transfer-Encoding, only apply to HTTP/1.1.

Frequently asked questions

Why is it spelled Referer?

A typo in the original 1996 specification that stuck.

Can JavaScript read all response headers?

Only safe ones, plus any the server lists in Access-Control-Expose-Headers.

Are X- headers standard?

No. X- marks custom or de facto headers; new ones no longer use the prefix.

How do I see a site's headers?

Open the browser's developer tools, Network tab, and select a request.

More Developer tools