Knowledge Base

HTTP Header Reference

Read the value as well as the name. The right interpretation depends on the response, the browser flow, and the job the header is meant to do.

Security and browser policies

Content-Security-Policy

Restricts resource loading and selected page behaviors. Read script and other directives individually; a permissive policy may provide limited protection. Report-only policies observe violations without enforcing their restrictions. Read the CSP reference.

Strict-Transport-Security

max-age sets the remembered HTTPS lifetime in seconds. includeSubDomains extends it to subdomains. Browsers ignore HSTS sent over HTTP. Preload is a separate deployment decision. Read the HSTS reference.

Frame protection

CSP frame-ancestors 'none' prevents embedding; 'self' permits same-origin ancestors. It has no default-src fallback. X-Frame-Options supports DENY and SAMEORIGIN; ALLOW-FROM is obsolete. Supporting browsers give an enforcing frame-ancestors policy precedence over X-Frame-Options. See CSP directives. Read the Frame protection reference.

X-Content-Type-Options

nosniff prevents MIME sniffing and makes scripts and styles fail when their declared type is unsuitable. Return a correct Content-Type as well: this header cannot fix a JavaScript file served as HTML. MDN X-Content-Type-Options documentation. Read the X-Content-Type-Options reference.

Referrer-Policy

strict-origin-when-cross-origin sends the full referrer for same-origin requests, only its origin across origins, and no referrer on a secure-to-insecure downgrade. no-referrer sends none. Modern browsers commonly default to the strict-origin policy, so absence does not imply full URL leakage. MDN Referrer-Policy documentation. Read the Referrer-Policy reference.

Permissions-Policy

Restricts selected browser capabilities, for example camera=(), microphone=(), geolocation=(). An empty allowlist denies the named feature; (self) limits it to the current origin, subject to other browser rules. Features and support vary. Missing policy is not automatically a vulnerability. MDN Permissions-Policy documentation. Read the Permissions-Policy reference.

Cross-Origin-Resource-Policy

CORP restricts cross-origin or cross-site no-cors resource loads. Its values are same-origin, same-site, and cross-origin. It is not the same permission as CORS response reading. A restrictive value can prevent intentional third-party embedding. MDN Cross-Origin-Resource-Policy documentation. Read the Cross-Origin-Resource-Policy reference.

COOP and COEP

Cross-Origin-Opener-Policy: same-origin separates browsing context groups across origins. Cross-Origin-Embedder-Policy: require-corp requires suitable permission for embedded cross-origin resources. Together, appropriate policies can support cross-origin isolation, but may break popups or embeds. Their absence is neutral unless the application needs them. Read the COOP reference and COEP reference.

MDN Cross-Origin-Opener-Policy documentation · MDN Cross-Origin-Embedder-Policy documentation

Legacy security headers

Do not add X-XSS-Protection: 1; mode=block to chase an old checklist. The legacy filter is deprecated and could introduce problems. Modern protection relies on safe application code and an appropriate CSP. Missing deprecated headers should not be treated as a security failure. MDN X-XSS-Protection documentation.

Caching and validation

Cache-Control

max-age controls freshness, s-maxage shared-cache freshness, and private cache scope. no-cache requires validation before reuse; no-store prohibits HTTP cache storage. Read the values and examples.

Expires

Sets an absolute HTTP date after which the response is stale. Applicable Cache-Control max-age or s-maxage takes precedence. An Expires header is not required when a suitable Cache-Control policy already supplies the lifetime. Read the Expires reference.

ETag

A quoted validator identifies a representation, for example "release-42". Clients can send it in If-None-Match for validation. W/"release-42" is weak: it indicates semantic equivalence rather than guaranteed byte identity. Correct validators can allow 304 responses instead of full downloads. Read the ETag reference.

Last-Modified

A modification date can be sent back in If-Modified-Since. Its timestamp precision is generally lower than an ETag's potential precision. Missing validators are not universally wrong, particularly for responses that should not be stored. Read the Last-Modified reference.

Vary

Names request fields that select a response variant, for example Vary: Accept-Encoding, Origin. A cache must match them before reuse. Vary: * prevents ordinary reuse of a stored response. Vary does not itself set a lifetime or authorize shared caching. MDN Vary documentation. Read the Vary reference.

Age

Estimates a cached response's age in seconds and affects its remaining freshness. It can show that an intermediary handled the response, but a missing Age field does not prove every possible cache was bypassed.

HTTP caching specification · Validator definitions · Choose a caching policy

CORS and cookies

CORS response headers

Access-Control-Allow-Origin defines which origin may read a response in a browser. Credentials, preflight permissions, and exposed headers have separate rules. CORS is not authentication, and a site may correctly omit it. Read the CORS reference.

Sets a cookie with its scope, lifetime, and security attributes. Multiple cookie-setting lines are expected and must remain separate. An unauthenticated page response may not reveal cookies used later. Read the cookie reference.

SameSite

Strict, Lax, and None control cross-site cookie delivery. None requires Secure, and browser third-party cookie restrictions still apply. Same-site is broader than same-origin. Compare the values.

Secure and HttpOnly

Secure limits cookie transport to HTTPS. HttpOnly blocks ordinary script access to the cookie but does not stop the browser sending it on requests. Choose attributes based on the cookie's purpose. See the boundaries.

Server and response metadata

Content-Type

Declares the media type, such as text/html; charset=UTF-8 or application/json. Correct types matter for rendering, script loading, and nosniff behavior. Read the Content-Type reference.

Server and X-Powered-By

May disclose software details. Reducing unnecessary version information is reasonable, but hiding a product name does not fix a vulnerability or prevent reliable software identification. Read about Server and X-Powered-By.

Status and redirects

Status codes and Location describe response outcomes and redirects. Check the final page as well as intermediate hops: their headers may differ. A header on one response cannot prove the whole website uses the same configuration. Read the Status and redirects reference.

Copyright ©2026 MILAN INNOVATIONS LLC. All rights reserved.