Site SEO AI Auditby Internet Solutions

Last-Modified, ETag and 304: HTTP Caching Headers for SEO

29 tháng 9, 20268 phút đọcSEO kỹ thuật
Last-Modified, ETag and 304: HTTP Caching Headers for SEO

Short answer: HTTP caching headers tell browsers and crawlers whether a page has changed since they last fetched it. When your server sends an ETag or Last-Modified header and answers repeat requests with 304 Not Modified when nothing changed, crawlers can skip downloading unchanged pages and spend their time on new or updated ones. It is not a ranking factor, but on larger sites it makes crawling more efficient, and wrong caching headers can hide real updates from search engines.

What HTTP caching headers are

Every time a browser or crawler requests a page, your server answers with a status code, a set of headers and the page itself. Some of those headers are about caching: they describe how long a copy may be reused and how a client can check whether its copy is still current. The rules are defined in the HTTP caching standard, RFC 9111, and explained in friendlier language in MDN’s guide to HTTP caching.

There are two families of caching headers, and it helps to keep them apart:

For SEO, validators matter most. Crawlers usually do not reuse a copy blindly for hours; they come back and ask whether the page changed. Validators let your server answer that question cheaply.

How conditional requests and 304 responses work

A conditional request is a normal request with one extra header that refers to the copy the client already has. The flow looks like this:

  1. The crawler fetches /services/ for the first time. Your server returns 200 OK, the HTML, and headers such as ETag: "a1b2c3" and Last-Modified: Tue, 08 Sep 2026 10:00:00 GMT.
  2. Days later, the crawler requests the same URL again and adds If-None-Match: "a1b2c3" and/or If-Modified-Since: Tue, 08 Sep 2026 10:00:00 GMT.
  3. If the page is unchanged, the server replies 304 Not Modified with no body. The crawler keeps its stored copy.
  4. If the page changed, the server replies 200 OK with the new HTML and a new ETag and Last-Modified.

A 304 response is tiny compared to a full HTML page, so the saving is real for both sides: less bandwidth and server work for you, and faster checks for the crawler. For a status code overview, see our guide to the HTTP status codes that matter for SEO.

Why caching headers matter for crawling

Google has documented that its crawlers support conditional requests with ETag/If-None-Match and Last-Modified/If-Modified-Since, and it has said that ETag is the less error-prone option when you can choose. Bing and other crawlers also understand these headers because they are a standard part of HTTP.

What you gain depends on the size of the site:

Be realistic about the effect. Caching headers do not make a page rank higher and they do not force a crawler to visit more often. They make each visit cheaper and more accurate.

ETag vs Last-Modified: which one to use

Both validators do the same job in different ways. Many servers send both, which is fine as long as they agree with each other.

Header What it contains Strengths Typical pitfalls
ETag An opaque identifier for one version of the response, often a hash of the content Precise; changes exactly when the content changes; no clock problems Differs between servers behind a load balancer; changes on every request if it includes timestamps or random tokens
Last-Modified The date and time the resource last changed Simple, human-readable, easy to generate from a database field Only one-second precision; often set to “now” on every request, or left at an old date after edits

If your platform lets you pick, use a content-based ETag and add an honest Last-Modified date. If you only have one, a correct Last-Modified is far better than an ETag that changes on every request.

Common caching mistakes that hurt SEO

Most problems come from caching that is either too eager or not honest about change:

How to check your caching headers

You can test the whole conditional request flow from a terminal in a couple of minutes:

  1. Fetch the headers of a page: curl -sI https://www.example.com/services/. Note the ETag, Last-Modified and Cache-Control values.
  2. Repeat the request with the validator: curl -sI -H 'If-None-Match: "a1b2c3"' https://www.example.com/services/. An unchanged page should return 304.
  3. Try If-Modified-Since with the Last-Modified value in the same way.
  4. Run the first request two or three times. If the ETag changes each time without any edit, it is unstable.
  5. Edit the page, clear any page cache, and run step 2 again. You must now get 200 and a new validator. If you still get 304, updates are being hidden.
  6. Check a few page types: home page, article, category, product and a PDF or image, because each may be served by a different layer.

In browser developer tools, the Network panel shows the same headers and marks responses served with 304. In Search Console, the Crawl Stats report groups responses by status code, so a healthy share of 304 responses on a large site is a sign that validation works.

Setting it up on common platforms

You rarely need to write caching logic yourself. Most stacks already send validators, and the task is to confirm they behave correctly:

For HTML, a short max-age plus validators is usually the safest combination: browsers and crawlers re-check often, and unchanged pages cost almost nothing. Pair this with the ideas in our article on server response time and TTFB if pages are slow even when they do change.

How a site-wide audit helps

Caching problems are rarely visible on one page; they show up as patterns across page types. Site SEO AI Audit crawls your site like a search engine, measures server response and compression on every page, and flags status code and redirect problems, so slow or inconsistent responses stand out by template. On WordPress sites each issue comes with fix steps in wp-admin. You can start with a free audit and re-check after you change caching settings.

Related reading

The bottom line

Send stable validators, answer conditional requests with 304 only when a page is truly unchanged, and make sure every real edit changes the ETag or Last-Modified date. Keep HTML cache lifetimes short and purge caches on publish. Done right, caching headers make every crawl visit cheaper; done wrong, they can hide your updates from search engines.

FAQ

Is a 304 Not Modified response bad for SEO?

No. A 304 simply tells the crawler that its stored copy is still current, so the page keeps its indexed content. It only becomes a problem when the server returns 304 for a page that has actually changed.

Does Googlebot use ETag and Last-Modified?

Yes. Google has documented that its crawlers support conditional requests with both ETag and Last-Modified. It recommends ETag when you can choose, because it avoids date formatting and clock problems.

Do caching headers improve rankings?

Not directly. They make crawling more efficient and can reduce server load, which helps large sites get new and updated pages crawled sooner. Rankings still depend on content, relevance and overall quality.

Should I set a long Cache-Control max-age for HTML pages?

Usually not. Long lifetimes suit versioned images, CSS and JavaScript. For HTML, a short lifetime with validators lets browsers and crawlers pick up changes quickly while unchanged pages stay cheap to check.

Why does my ETag change on every request?

The page probably contains something that differs per request, such as a timestamp, security token or random element, or several servers compute different values. Remove per-request values from the body or configure a consistent ETag.

#Crawling#Page speed#Technical SEO
Kiểm tra website của bạn — miễn phí.Mọi lỗi SEO trên website của bạn — và cách sửa chính xác.
Bắt đầu miễn phí
Internet Solutions

Sản phẩm khác từ đội ngũ chúng tôi

Do Internet Solutions phát triển. Hãy thử các sản phẩm khác của chúng tôi — mỗi sản phẩm giúp bạn tiết kiệm thời gian theo một cách riêng.

internet-solutions.net ↗
01Tự động đăng mạng xã hội
PostRSS

Bài mới từ nguồn cấp RSS của bạn được tự động đăng lên Facebook, X, LinkedIn, Telegram và hơn 60 mạng khác.

Gói miễn phí · từ 2014Truy cập →
02Chat trực tuyến AI cho website
Talkmio

Website của bạn trả lời khách truy cập 24/7 từ chính nội dung của bạn, bằng ngôn ngữ của họ.

Gói miễn phí · không cần thẻTruy cập →
03Trợ lý AI
Ask Mio

Trò chuyện, viết code, thiết kế, viết bài và nghiên cứu. Mio chọn mô hình tốt nhất cho từng việc.

Gói miễn phíTruy cập →
04Lái tự động AI cho blog và mạng xã hội
AI Blog Autopilot

AI viết bài SEO dài 2.000–3.000 từ và chia sẻ từng bài lên hơn 58 mạng xã hội.

3 bài đầu tiên miễn phíTruy cập →
05Kiểm tra sức khỏe website
Site AI Audit

SEO, tốc độ, SSL, bảo mật và cấu hình email trong một báo cáo, sắp xếp theo việc cần sửa trước.

Lần kiểm tra đầu tiên miễn phíTruy cập →
06Nguồn cấp RSS và sản phẩm
RSS Feed Creator

Tạo RSS từ bất kỳ trang web nào, cùng nguồn cấp sản phẩm cho Google và Meta tự động cập nhật.

Gói miễn phíTruy cập →
07Phát triển website và SEO
Internet Solutions

Website, cửa hàng trực tuyến và hệ thống theo yêu cầu, do đội ngũ của chúng tôi thiết kế, xây dựng và vận hành.

Từ 2011Truy cập →
Site SEO AI Audit
Tổng quan quyền riêng tư

Website này dùng cookie để mang lại trải nghiệm người dùng tốt nhất có thể. Thông tin cookie được lưu trong trình duyệt của bạn và thực hiện các chức năng như nhận ra bạn khi bạn quay lại, giúp đội ngũ chúng tôi hiểu phần nào của website bạn thấy thú vị và hữu ích nhất.