{"id":80,"date":"2026-10-30T06:05:27","date_gmt":"2026-10-30T06:05:27","guid":{"rendered":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/"},"modified":"2026-10-30T06:05:27","modified_gmt":"2026-10-30T06:05:27","slug":"http-caching-headers-cache-control-etag-expires","status":"publish","type":"post","link":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/","title":{"rendered":"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires"},"content":{"rendered":"<p>A fast website is not only about a powerful server. Browsers, proxies, and content delivery networks can store copies of files and reuse them instead of downloading the same data for every visit. HTTP caching headers tell those systems what may be stored, for how long, and when a cached response must be checked again.<\/p>\n<p>Used well, caching reduces bandwidth, improves page speed, and lowers server load. Used carelessly, it can leave visitors seeing outdated pages or expose personalized content to a shared cache.<\/p>\n<h2>Cache-Control Sets the Main Rules<\/h2>\n<p><code>Cache-Control<\/code> is the primary header for modern HTTP caching. A response such as <code>Cache-Control: public, max-age=3600<\/code> allows a cache to reuse the response for one hour without contacting the origin server. The <code>public<\/code> directive permits shared caches to store it, while <code>private<\/code> limits storage to a user&#8217;s browser.<\/p>\n<p>The names of two directives often cause confusion. <code>no-cache<\/code> does not mean \u201cnever store this response.\u201d It means the cached copy must be validated before reuse. <code>no-store<\/code> tells caches not to store the response at all and is more appropriate for highly sensitive data.<\/p>\n<h2>ETag and Last-Modified Enable Validation<\/h2>\n<p>When a cached response becomes stale, the browser does not always need the complete file again. An <code>ETag<\/code> identifies a particular version of a resource. The browser can send that value in an <code>If-None-Match<\/code> request, allowing the server to reply with <code>304 Not Modified<\/code> when the file has not changed.<\/p>\n<p><code>Last-Modified<\/code> and <code>If-Modified-Since<\/code> provide a similar time-based mechanism. These validators save bandwidth because a 304 response has no representation body. If you want to understand the other responses that may appear during testing, see our guide to <a href=\"https:\/\/www.tempohosting.co.uk\/blog\/http-status-codes-explained-for-website-owners\/\" target=\"_blank\" rel=\"noopener\">HTTP status codes for website owners<\/a>.<\/p>\n<h2>Use Different Policies for HTML and Static Files<\/h2>\n<p>One caching policy rarely fits an entire website. Versioned CSS, JavaScript, fonts, and images can usually use a long lifetime because a changed filename or query version creates a new URL. A year-long <code>max-age<\/code> combined with <code>immutable<\/code> can work well for assets whose URLs change whenever their contents change.<\/p>\n<p>HTML pages require more care because their URLs usually remain stable. A short lifetime or <code>no-cache<\/code> with validators helps visitors receive current content while still benefiting from conditional requests. Logged-in pages and personalized responses should normally be marked <code>private<\/code> to prevent shared caches from serving one user&#8217;s content to another.<\/p>\n<h2>Test the Headers Your Server Sends<\/h2>\n<p>Do not assume a plugin or server configuration produces the intended result. Inspect response headers for the homepage, an article, and several static assets. Our practical guide to <a href=\"https:\/\/www.tempohosting.co.uk\/blog\/test-website-with-curl-status-redirects-timing-tls\/\" target=\"_blank\" rel=\"noopener\">testing a website with curl<\/a> shows how to retrieve headers and check response behaviour from the command line.<\/p>\n<p>After making changes, test in a private browser session and verify both the first response and a repeat request. Watch for unexpected <code>Age<\/code> headers, stale HTML, missing validators, or private pages marked public. Also confirm that deployment changes create new asset URLs when long-lived caching is enabled.<\/p>\n<h2>A Practical Caching Strategy<\/h2>\n<p>Start conservatively: cache versioned static assets for a long period, require validation for frequently updated HTML, and keep private responses out of shared caches. Then measure performance and adjust lifetimes based on how often each resource changes. Caching should be explicit, testable, and matched to the content rather than applied as one universal switch.<\/p>\n<p>For detailed examples and the precise behaviour of the directives and validators described here, consult MDN&#8217;s <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Guides\/Caching\" target=\"_blank\" rel=\"noopener\">official HTTP caching guide<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how HTTP caching headers such as Cache-Control and ETag improve website speed, reduce bandwidth, and keep content safely up to date.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[36],"tags":[69,70,68,6,71],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-web-hosting","tag-cache-control","tag-etag","tag-http-caching","tag-web-hosting","tag-website-speed"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HTTP Caching Headers Explained: Cache-Control, ETag, and Expires - Tempo Hosting Blog<\/title>\n<meta name=\"description\" content=\"Learn how HTTP caching headers such as Cache-Control and ETag improve website speed, reduce bandwidth, and keep content safely up to date.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires - Tempo Hosting Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how HTTP caching headers such as Cache-Control and ETag improve website speed, reduce bandwidth, and keep content safely up to date.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/\" \/>\n<meta property=\"og:site_name\" content=\"Tempo Hosting Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-30T06:05:27+00:00\" \/>\n<meta name=\"author\" content=\"Arthur Edward\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arthur Edward\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/\"},\"author\":{\"name\":\"Arthur Edward\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/0c5cdd8616ac5c6b1d288da7ec3dd903\"},\"headline\":\"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires\",\"datePublished\":\"2026-10-30T06:05:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/\"},\"wordCount\":550,\"commentCount\":0,\"keywords\":[\"Cache-Control\",\"ETag\",\"HTTP caching\",\"Web Hosting\",\"website speed\"],\"articleSection\":[\"Web Hosting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/\",\"url\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/\",\"name\":\"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires - Tempo Hosting Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#website\"},\"datePublished\":\"2026-10-30T06:05:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/0c5cdd8616ac5c6b1d288da7ec3dd903\"},\"description\":\"Learn how HTTP caching headers such as Cache-Control and ETag improve website speed, reduce bandwidth, and keep content safely up to date.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/http-caching-headers-cache-control-etag-expires\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/\",\"name\":\"Tempo Hosting Blog\",\"description\":\"Practical guides to web hosting, websites, domains and online success.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/0c5cdd8616ac5c6b1d288da7ec3dd903\",\"name\":\"Arthur Edward\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g\",\"caption\":\"Arthur Edward\"},\"url\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/author\\\/arthur-edward\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires - Tempo Hosting Blog","description":"Learn how HTTP caching headers such as Cache-Control and ETag improve website speed, reduce bandwidth, and keep content safely up to date.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/","og_locale":"en_US","og_type":"article","og_title":"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires - Tempo Hosting Blog","og_description":"Learn how HTTP caching headers such as Cache-Control and ETag improve website speed, reduce bandwidth, and keep content safely up to date.","og_url":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/","og_site_name":"Tempo Hosting Blog","article_published_time":"2026-10-30T06:05:27+00:00","author":"Arthur Edward","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Arthur Edward","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/#article","isPartOf":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/"},"author":{"name":"Arthur Edward","@id":"https:\/\/www.tempohosting.co.uk\/blog\/#\/schema\/person\/0c5cdd8616ac5c6b1d288da7ec3dd903"},"headline":"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires","datePublished":"2026-10-30T06:05:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/"},"wordCount":550,"commentCount":0,"keywords":["Cache-Control","ETag","HTTP caching","Web Hosting","website speed"],"articleSection":["Web Hosting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/","url":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/","name":"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires - Tempo Hosting Blog","isPartOf":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/#website"},"datePublished":"2026-10-30T06:05:27+00:00","author":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/#\/schema\/person\/0c5cdd8616ac5c6b1d288da7ec3dd903"},"description":"Learn how HTTP caching headers such as Cache-Control and ETag improve website speed, reduce bandwidth, and keep content safely up to date.","breadcrumb":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.tempohosting.co.uk\/blog\/http-caching-headers-cache-control-etag-expires\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tempohosting.co.uk\/blog\/"},{"@type":"ListItem","position":2,"name":"HTTP Caching Headers Explained: Cache-Control, ETag, and Expires"}]},{"@type":"WebSite","@id":"https:\/\/www.tempohosting.co.uk\/blog\/#website","url":"https:\/\/www.tempohosting.co.uk\/blog\/","name":"Tempo Hosting Blog","description":"Practical guides to web hosting, websites, domains and online success.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tempohosting.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.tempohosting.co.uk\/blog\/#\/schema\/person\/0c5cdd8616ac5c6b1d288da7ec3dd903","name":"Arthur Edward","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g","caption":"Arthur Edward"},"url":"https:\/\/www.tempohosting.co.uk\/blog\/author\/arthur-edward\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":0,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}