What does Google say about SEO? /

Official statement

The HTTP 304 code should only be returned in response to a conditional request (If-Modified-Since). Returning a 304 on a normal request is like not returning any content, thus preventing indexing. For sitemaps, returning 304, 404, or an empty file when there is no update is acceptable.
9:01
🎥 Source video

Extracted from a Google Search Central video

⏱ 56:47 💬 EN 📅 04/08/2020 ✂ 39 statements
Watch on YouTube (9:01) →
Other statements from this video 38
  1. 1:08 How does my site get included in the Chrome User Experience Report without signing up?
  2. 1:08 How does your site end up in the Chrome User Experience Report?
  3. 2:10 How can you measure Core Web Vitals when your site isn't in CrUX?
  4. 3:14 Can negative reviews really penalize your Google ranking?
  5. 3:14 Can negative reviews really hurt your Google ranking?
  6. 7:57 Should you really separate sitemaps for pages and images?
  7. 7:57 Does splitting your sitemaps truly impact crawling and indexing?
  8. 9:01 Could a 304 Not Modified code actually prevent your pages from being indexed?
  9. 11:39 Does Google Cache Really Influence the Ranking of Your Pages?
  10. 11:39 Is Google Cache really not useful for assessing a page's SEO quality?
  11. 13:51 Why doesn't your niche change generate any traffic despite all your SEO efforts?
  12. 14:51 Are link directories truly dead for SEO?
  13. 17:59 Do translated pages really count as duplicate content in Google's eyes?
  14. 17:59 Are translated pages really treated as unique content by Google?
  15. 20:20 Why does Google ignore your canonical tags, and how can you enforce separate indexing for your regional URLs?
  16. 22:15 Why does Google overlook your canonical on multi-country sites?
  17. 23:14 Why is your Search Console crawl budget skyrocketing for seemingly no reason?
  18. 23:18 Why is your Search Console crawl budget skyrocketing for no apparent reason?
  19. 25:52 Should you really limit the crawl rate in Search Console?
  20. 26:58 Hreflang and geo-targeting: Can Google really ignore your international signals?
  21. 28:58 Are Hreflang and Canonical really reliable for geographic targeting?
  22. 34:26 Why is Search Console showing the wrong URL for Hreflang and Canonical?
  23. 34:26 Why does Search Console display a different canonical than what appears in the SERP for your hreflang pages?
  24. 38:38 How does Google really differentiate between two sites in the same language but targeting different countries?
  25. 38:42 Should you canonicalize all your country versions to a single URL?
  26. 38:42 Should you really keep each hreflang page self-canonical?
  27. 39:13 How can local signals help you prevent canonicalization between your multi-country pages?
  28. 43:13 Should you really abandon country variations in hreflang?
  29. 45:34 Is it really necessary to use hreflang for a multilingual website?
  30. 47:44 Do Facebook comments really impact your site's SEO and EAT?
  31. 48:51 Should you isolate UGC and News content in subdomains to avoid penalties?
  32. 50:58 Should you create a lightweight version for Googlebot to speed up crawling?
  33. 50:58 Should you focus on optimizing your site speed for Googlebot or your actual users?
  34. 50:58 Should you serve a streamlined version of your pages to Googlebot to improve crawl efficiency?
  35. 52:33 Can you create local pages by city without risking penalties for doorway pages?
  36. 52:33 How can you tell a legitimate city page from a penalizable doorway page?
  37. 54:38 Has Google's manual action for doorway pages disappeared in favor of algorithmic solutions?
  38. 54:38 Are doorway pages still subject to manual penalties from Google?
📅
Official statement from (5 years ago)
TL;DR

Google reminds us that the HTTP 304 code should only be returned in response to a conditional request (If-Modified-Since or If-None-Match). On a normal request without conditions, a 304 prevents indexing as no content is sent to the crawler. For XML sitemaps, three valid options when there is no update: 304, 404, or an empty file—Google handles all of them correctly.

What you need to understand

What issues does the 304 code cause on a normal request?

A conditional request signals to the server: "I already have a version of this resource dated X, send me the content only if you have a more recent version." This logic relies on the HTTP headers If-Modified-Since or If-None-Match. When the server responds with 304, it says: "Your version is up-to-date, no need to download again."

On a normal request—without a conditional header—the server cannot assume that the client already has the content. Returning a 304 in this case is equivalent to saying "Nothing has changed" while the crawler has never accessed the reference version. The result: Googlebot receives no HTML, cannot analyze the content, and the page remains unindexed or disappears from the index if it was already there.

Do XML sitemaps make an exception to this rule?

Yes—and that's one of the most pragmatic points of this statement. For XML sitemaps, Google accepts three behaviors when no updates have happened: returning a 304 (on a valid conditional request), returning a 404, or serving an empty file. All these responses indicate to Googlebot that there is nothing new to crawl.

This flexibility is explained by the nature of the sitemap: it’s a coordination file, not a full content page. Google is not looking to index the sitemap itself, but to identify the URLs to explore. If the sitemap hasn’t changed, there’s no need to retransmit it—a signal is enough.

How can you differentiate a conditional request from a normal request?

On the server side, the presence of the If-Modified-Since or If-None-Match headers in the HTTP request is the only reliable criterion. The first compares a date, the second a unique version identifier (ETag). If either of these headers is absent, the request is considered normal and should receive a 200 OK with full content — or an appropriate error code (404, 410, etc.).

In server logs, a conditional request is easily identified: the line contains the relevant header. On a CDN platform (Cloudflare, Fastly, Akamai), these requests are often managed automatically if the Last-Modified and ETag headers are correctly configured on the origin side. But beware: some default configurations return erroneous 304s on normal requests—particularly for dynamically generated pages with a poorly configured cache.

  • A 304 code is legitimate only if the request includes If-Modified-Since or If-None-Match.
  • On a normal request, a 304 blocks indexing by depriving the crawler of content.
  • XML sitemaps tolerate 304, 404, or an empty file when there are no updates.
  • Check your server logs for incorrectly returned 304s on requests without a conditional header.
  • Default CDN configurations do not always guarantee compliance—audit your caching rules.

SEO Expert opinion

Does this statement correct a widespread practice?

Absolutely. In the field, we regularly observe server or CDN configurations that return systematic 304s to save bandwidth—without verifying if the request is truly conditional. The intention is commendable (optimizing performance), but the effect is catastrophic for indexing. Googlebot, in the absence of conditional headers in its initial requests to a new URL, receives a 304 and concludes there’s nothing to index.

This confusion is particularly common on dynamic e-commerce sites where the application cache (Varnish, Redis) is configured to serve 304s as soon as a file "hasn't changed"—without examining the incoming request. The result: recently added product pages remain invisible on Google for weeks until a forced crawl or cache purge prompts a 200. [To be verified] if your tech stack correctly distinguishes between conditional and normal requests.

Why does Google tolerate three behaviors for sitemaps?

Because the XML sitemap is merely a navigation index—not a full content resource. Google wants to know if there are new URLs to explore, not to index the sitemap file itself. Returning a temporary 404 when no modification has taken place might seem counterintuitive, but it's an accepted convention: "This sitemap does not exist in its updated version, come back later."

In practice, most CMSs and sitemap generators still serve a 200 with the full file even if nothing has changed. This is the simplest and most reliable solution—no risk of misinterpretation. But for very large sites (millions of URLs), regenerating and serving a sitemap of several hundred MB for each Googlebot request represents a non-negligible server load. Hence the interest in conditional 304s or empty files.

What warning signs indicate a 304 issue?

Three classic symptoms: recent pages not appearing in the index despite being present in the sitemap, an abnormally low coverage rate in Search Console (URLs discovered but not crawled), and server logs showing sequences of 304s on URLs never crawled before. If Googlebot has never received the initial content, it cannot know that "nothing has changed."

Another clue: a CDN or reverse cache configuration that shows a hit rate (cache success rate) exceeding 95% on theoretically new pages. This often means the cache is responding with a 304 by default, without validating the nature of the request. Test your URLs with curl by deliberately omitting the If-Modified-Since headers—if you get a 304, you have a problem.

Attention: Hosted platforms (Shopify, WordPress.com, Wix) typically manage 304s correctly by default, but custom configurations on dedicated servers or VPS require a manual audit. Never assume that your tech stack adheres to this rule—verify.

Practical impact and recommendations

How can you check if your server correctly handles 304s?

Run a test with curl or an HTTP diagnostic tool (Postman, Insomnia) on an indexable URL. First request without a conditional header: you should receive a 200 OK with full HTML. Note the value of the Last-Modified or ETag header in the response. Then replay the request by adding If-Modified-Since with the retrieved date—this time, a 304 is expected.

If the first request (without conditions) returns a 304, your configuration is faulty. Review your Apache mod_headers, Nginx expires, or CDN settings. On Cloudflare, for example, the "Respect Existing Headers" option can cause unwanted 304s if the origin doesn’t handle the conditional headers properly.

What errors should you absolutely avoid?

Never configure your server to return a 304 "by default" on all GET requests without analyzing the headers. Some performance optimization tutorials recommend aggressive caching rules that do not differentiate between request types—ignore such advice. A wrongly placed 304 costs infinitely more in lost organic traffic than it saves in bandwidth.

Another trap: client-side rendered JavaScript pages (React, Vue, Angular) where the server returns a minimal HTML shell with a 304 for dynamic content. If Googlebot never receives the complete initial HTML, it cannot execute the JS properly. Ensure that the first server response contains enough indexable content—even if the final rendering depends on JS.

What configuration do you recommend for XML sitemaps?

The most robust solution remains to always serve a 200 OK with the complete sitemap file, even if it hasn’t changed. It’s simple, predictable, and introduces no risk of misinterpretation. If server load becomes an issue (sitemap > 50 MB, very frequent crawls), implement a conditional 304 mechanism based on the last modification date of the file.

Avoid a temporary 404 unless your sitemap generation is event-driven (triggered only after content addition/modification). A permanent 404 on the sitemap declared in robots.txt generates errors in Search Console and can delay the discovery of new URLs. The empty file (0 bytes with 200 OK) works but can disrupt some XML parsers—serving the last valid sitemap remains preferable.

  • Test your URLs with curl without the If-Modified-Since header—they should return 200, never 304.
  • Ensure your Last-Modified and ETag headers are correctly generated and consistent.
  • Audit your CDN and reverse cache rules to spot incorrectly returned 304s on normal requests.
  • For sitemaps, favor a systematic 200 OK unless documented server load constraints apply.
  • Monitor Googlebot access logs for abnormal sequences of 304s on recent URLs.
  • Document your caching configuration in an accessible runbook for the tech team—poorly configured 304s are often introduced during infrastructure updates.
Correct management of 304 codes relies on a fine analysis of HTTP headers and coordination between the origin server, application cache, and CDN. An error at any level of this chain can block indexing of entire sections of your site. These optimizations require sharp technical expertise and continuous monitoring of observed behaviors in production. If your internal team lacks resources or expertise in these infrastructure aspects, consider support from a specialized technical SEO agency—a thorough server audit will quickly identify risky configurations and help avoid costly visibility losses.

❓ Frequently Asked Questions

Un code 304 peut-il désindexer des pages déjà présentes dans Google ?
Oui. Si votre serveur se met à retourner des 304 sur requêtes normales, Googlebot ne récupère plus de contenu lors des recrawls et peut finir par retirer ces pages de l'index, les considérant comme devenues inaccessibles ou vides.
Les en-têtes ETag sont-ils préférables à Last-Modified pour les 304 ?
Les deux fonctionnent. ETag offre une granularité plus fine (basée sur un hash du contenu) tandis que Last-Modified repose sur une date. En pratique, implémenter les deux maximise la compatibilité avec différents clients et crawlers.
Cloudflare ou Fastly gèrent-ils automatiquement les 304 correctement ?
Généralement oui, à condition que votre serveur origine renvoie les bons en-têtes Last-Modified et ETag. Mais certaines règles de cache personnalisées peuvent court-circuiter cette logique — auditez toujours votre configuration spécifique.
Faut-il désactiver complètement les 304 si on a un doute sur la configuration ?
Non. Les 304 correctement implémentés réduisent la charge serveur et accélèrent le crawl. Corrigez la configuration plutôt que de désactiver une fonctionnalité HTTP standard — testez simplement que les requêtes sans condition obtiennent bien un 200.
Le code 304 impacte-t-il le budget de crawl ?
Indirectement : si Googlebot reçoit des 304 erronés, il perd du temps sur des URLs qui ne livrent pas de contenu, réduisant le nombre de pages utiles explorées. Un 304 légitime, en revanche, optimise le budget en évitant de retélécharger du contenu inchangé.
🏷 Related Topics
Content Crawl & Indexing HTTPS & Security Pagination & Structure PDF & Files Search Console

🎥 From the same video 38

Other SEO insights extracted from this same Google Search Central video · duration 56 min · published on 04/08/2020

🎥 Watch the full video on YouTube →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.