Request and Response Headers
You'll learn how to inspect HTTP headers in DevTools to decode caching rules, content formats, cross-origin permissions, and security configurations.
What HTTP Headers Are
Think of HTTP headers as the metadata envelope around your web content—like the addressing, handling instructions, and security seals on a physical package. While the response body contains the actual content (HTML, JSON, images), headers carry essential instructions about how to handle that content.
When you click a resource in the Network panel and view the Headers tab, you see two sections: request headers (what your browser sent) and response headers (what the server replied with).
Key Headers to Inspect
Caching Directives:
Cache-Control: max-age=3600, publictells browsers and CDNs how long to store the resourceETagandLast-Modifiedenable validation without re-downloading
Content Information:
Content-Type: text/html; charset=UTF-8specifies what you receivedContent-Encoding: gzipshows compression appliedContent-Lengthindicates size in bytes
CORS Headers:
Access-Control-Allow-Origin: *permits cross-origin requestsAccess-Control-Allow-Methodslists allowed HTTP methods
Security Policies:
Strict-Transport-Securityenforces HTTPSContent-Security-Policyrestricts resource loadingX-Frame-Optionsprevents clickjacking
Why This Matters
Inspecting headers helps you diagnose issues like stale caches, CORS blocking, unexpected compression, or missing security policies. You can verify your server configuration matches your intentions.
Key Takeaway: Request and response headers are the instruction manual for how browsers, CDNs, and servers should handle each resource—master reading them to diagnose caching, security, and delivery issues effectively.