What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 3 questions

Less than 30 seconds. Find out how much you really know about Google search.

🕒 ~30s 🎯 3 questions 📚 SEO Google

Official statement

The 304 Not Modified code should only be returned for conditional requests (with If-Modified-Since). For normal requests, returning a 304 means that no content is available, which prevents indexing. For an empty sitemap, it is better to return an empty file, a 404, or a 304 depending on the context, but not a blind 304.
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 Comment mon site entre-t-il dans le Chrome User Experience Report sans inscription ?
  2. 1:08 Comment votre site se retrouve-t-il dans le Chrome User Experience Report ?
  3. 2:10 Comment mesurer les Core Web Vitals quand votre site n'est pas dans CrUX ?
  4. 3:14 Les avis négatifs peuvent-ils vraiment pénaliser votre classement Google ?
  5. 3:14 Les avis négatifs peuvent-ils vraiment pénaliser votre ranking Google ?
  6. 7:57 Faut-il vraiment séparer sitemaps pages et images ?
  7. 7:57 Le découpage des sitemaps affecte-t-il vraiment le crawl et l'indexation ?
  8. 9:01 Le code 304 Not Modified est-il vraiment un piège pour votre indexation ?
  9. 11:39 Le cache Google influence-t-il vraiment le ranking de vos pages ?
  10. 11:39 Le cache Google est-il vraiment inutile pour évaluer la qualité SEO d'une page ?
  11. 13:51 Pourquoi votre changement de niche ne génère-t-il aucun trafic malgré tous vos efforts SEO ?
  12. 14:51 Les annuaires de liens sont-ils définitivement morts pour le SEO ?
  13. 17:59 Les pages traduites comptent-elles vraiment comme du contenu dupliqué aux yeux de Google ?
  14. 17:59 Les pages traduites sont-elles vraiment considérées comme du contenu unique par Google ?
  15. 20:20 Pourquoi Google ignore-t-il vos balises canonical et comment forcer l'indexation séparée de vos URLs régionales ?
  16. 22:15 Pourquoi Google ignore-t-il votre canonical sur les sites multi-pays ?
  17. 23:14 Pourquoi votre crawl budget Search Console explose-t-il sans raison apparente ?
  18. 23:18 Pourquoi votre crawl budget Search Console explose-t-il sans raison apparente ?
  19. 25:52 Faut-il vraiment limiter le taux de crawl dans Search Console ?
  20. 26:58 Hreflang et géociblage : Google peut-il vraiment ignorer vos signaux internationaux ?
  21. 28:58 Hreflang et canonical sont-ils vraiment fiables pour le ciblage géographique ?
  22. 34:26 Hreflang et canonical : pourquoi Search Console affiche-t-il la mauvaise URL ?
  23. 34:26 Pourquoi Search Console affiche-t-elle un canonical différent de ce qui apparaît dans les SERP pour vos pages hreflang ?
  24. 38:38 Comment Google différencie-t-il vraiment deux sites en même langue mais ciblant des pays différents ?
  25. 38:42 Faut-il canonicaliser toutes vos versions pays vers une seule URL ?
  26. 38:42 Faut-il vraiment garder chaque page hreflang en self-canonical ?
  27. 39:13 Comment éviter la canonicalisation entre vos pages multi-pays grâce aux signaux locaux ?
  28. 43:13 Faut-il vraiment abandonner les déclinaisons pays dans hreflang ?
  29. 45:34 Faut-il vraiment utiliser hreflang pour un site multilingue ?
  30. 47:44 Les commentaires Facebook ont-ils un impact sur le SEO et l'EAT de votre site ?
  31. 48:51 Faut-il isoler le contenu UGC et News en sous-domaines pour éviter les pénalités ?
  32. 50:58 Faut-il créer une version Googlebot allégée pour accélérer l'exploration ?
  33. 50:58 Faut-il optimiser la vitesse de votre site pour Googlebot ou pour vos utilisateurs ?
  34. 50:58 Faut-il servir une version allégée de vos pages à Googlebot pour améliorer le crawl ?
  35. 52:33 Peut-on créer des pages locales par ville sans risquer une pénalité pour doorway pages ?
  36. 52:33 Comment différencier une page par ville légitime d'une doorway page sanctionnable ?
  37. 54:38 L'action manuelle Google pour doorway pages a-t-elle disparu au profit de l'algorithmique ?
  38. 54:38 Les doorway pages sont-elles encore sanctionnées manuellement par Google ?
📅
Official statement from (5 years ago)
TL;DR

Google states that the HTTP 304 code should only be returned for conditional requests that include an If-Modified-Since header or similar. For a normal request without a condition, a 304 indicates the absence of content and blocks indexing by Googlebot. This technical distinction between conditional requests and standard requests is crucial to avoid inadvertently deindexing functional content.

What you need to understand

What is a conditional request and how does the 304 code work?

A conditional request contains specific headers like If-Modified-Since or If-None-Match. The browser or bot asks the server: "I have a version from January 15th, is there anything new?" If nothing has changed, the server responds with 304 and saves bandwidth by not returning the body of the response.

The 304 is therefore an optimization mechanism, not an error code. It assumes that a valid version already exists on the client side. This is why Google emphasizes context: this code only makes sense when a condition is explicitly set.

What happens if we return a 304 for a normal request?

For a request without a conditional header, a 304 becomes problematic. The bot has no cached version and is expecting content. Upon receiving a 304, Googlebot interprets this as "no content available" and therefore cannot index the page.

In practical terms? Your page disappears from the index. This is particularly sneaky because the server does not send a blatant error—just a technically valid empty response that is semantically incorrect in this context.

Why does this error frequently occur with sitemaps?

XML sitemaps are files that are regularly crawled but rarely modified. Some developers implement an aggressive caching mechanism that systematically returns a 304, even without a conditional request, with the idea of saving resources.

The problem: Googlebot, discovering the sitemap for the first time or after a cache purge, receives a blind 304. As a result, it is unable to read the listed URLs. Mueller suggests several alternatives depending on the case: a valid empty XML file, a 404 if the sitemap no longer exists, or a 304 only if a conditional request is detected.

  • The 304 code is reserved for conditional requests with If-Modified-Since or If-None-Match headers
  • A 304 for a normal request indicates the absence of content and blocks indexing
  • Misconfigured sitemaps are a frequent source of this error
  • Correct alternatives: empty file, 404, or conditional 304 only
  • Check server logic to ensure that a 304 is never returned blindly

SEO Expert opinion

Is this statement consistent with real-world observations?

Absolutely. Cases of mysterious deindexation linked to misconfigured 304s are not rare, especially on custom CMS or e-commerce platforms with poorly configured Varnish/Nginx caches. The classic error: a developer sets up an HTTP cache without distinguishing initial requests from validation requests.

Server logs then show systematic 304s for Googlebot, which does not, however, have any cached version. The Search Console displays "Crawled, currently not indexed" without further explanation, and one must dive into the headers to understand. It’s a silent bug that can persist for months.

In what cases does this rule not apply or become fuzzy?

Mueller remains vague on CDN scenarios and reverse proxy issues. Some CDNs return 304s based on their own cache state, regardless of the initial conditional header. Does Googlebot tolerate this situation if the CDN has previously served the content? [To be verified]

Another gray area: static resources (CSS, JS, images). Google does not detail whether the rule also applies so strictly. In practice, static resources with blind 304s pose fewer direct indexing issues, but can affect rendering if Googlebot cannot load critical CSS. The official discourse lacks granularity on this point.

Should the 304 be completely banned from sitemaps?

No, that would be an overreaction. The conditional 304 on a sitemap is perfectly legitimate and saves crawl budget when implemented correctly. The trap lies in the implementation: many frameworks return a 304 by default without checking for the presence of the If-Modified-Since header.

Mueller's recommendation regarding the empty file is pragmatic for temporarily empty sitemaps (new section of the site not yet indexed, for example). A valid XML file with without URLs clearly indicates "nothing to crawl for now" without ambiguity. It’s cleaner than a 404 that could signal a configuration error.

Attention: Some servers configured with mod_deflate or gzip return a 304 if the compressed content has not changed, regardless of the conditional header. Check the complete processing chain, not just the application code.

Practical impact and recommendations

How can you ensure your server does not return a blind 304?

Test your URLs and sitemaps with curl or Postman by emulating Googlebot. Make a request without a conditional header: curl -I -A "Googlebot" https://example.com/sitemap.xml. If you get a 304, that's a blatant issue.

Next, test with a conditional header: curl -I -H "If-Modified-Since: Mon, 01 Jan 2024 00:00:00 GMT" https://example.com/sitemap.xml. Here, a 304 is expected if the file has not changed since that date. The difference in behavior between the two requests should be clear.

Which server configurations should be audited as a priority?

Reverse proxies like Varnish or Nginx are the main suspects. Check the caching logic: the 304 should be contingent on the presence of a validation header, not on the existence of a cached entry on the server side.

On the application side, PHP frameworks (Symfony, Laravel) and Node.js (Express) often have HTTP caching middleware. Ensure they only return a 304 if req.headers['if-modified-since'] or if-none-match is present and matches the current version. A boolean flag "isCached" is not sufficient.

What should you do if you discover a blind 304 on indexed pages?

Immediately correct the configuration and force a recrawl via Search Console for critical URLs. For a sitemap, resubmit it once the fix is deployed. Pages that have already been deindexed can take several weeks to return depending on the site’s crawl budget.

Monitor the index coverage in Search Console over the following weeks. A sharp drop in indexed pages coinciding with a cache deployment is a warning sign. Server logs should show a normal distribution of 200/304 codes, not a systematic 304.

  • Test each critical URL with curl without a conditional header and check for the absence of 304
  • Audit Varnish/Nginx/CDN configuration to condition 304 to validation headers
  • Ensure that application middleware explicitly checks If-Modified-Since or If-None-Match
  • Set up a monitoring alert on the 304/200 ratio by bot type (Googlebot vs users)
  • Document the HTTP caching logic to prevent regressions during updates
  • For empty sitemaps, prefer a valid empty XML file rather than a 404 or 304
The 304 code is a powerful optimization tool but potentially destructive if misconfigured. The rule is simple: only for explicit conditional requests. Everything else risks deindexation. These server optimizations touch on technical layers that can be complex between application, reverse proxy, and CDN. If your team lacks expertise on these issues or needs a full audit of your HTTP stack, engaging a specialized SEO agency can save you months and avoid costly visibility mistakes.

❓ Frequently Asked Questions

Un 304 sur un sitemap vide est-il acceptable si je détecte le header If-Modified-Since ?
Oui, c'est l'usage correct du 304. Si le sitemap n'a pas changé depuis la date fournie dans le header, retourner un 304 est légitime et économise du crawl budget. L'erreur serait de retourner un 304 sans vérifier ce header.
Googlebot envoie-t-il systématiquement des headers conditionnels lors de ses crawls ?
Non, pas systématiquement. Googlebot peut crawler une page sans header If-Modified-Since, notamment lors de la première découverte ou après un vidage de cache. C'est pourquoi un 304 aveugle pose problème.
Un CDN qui retourne un 304 basé sur son propre cache peut-il bloquer l'indexation ?
Potentiellement oui, si le CDN retourne un 304 sans que Googlebot ait envoyé de requête conditionnelle. La plupart des CDN modernes gèrent correctement cette distinction, mais il faut vérifier la configuration spécifique.
Quelle est la différence entre un sitemap vide (fichier XML valide) et un 404 ?
Un fichier XML vide indique "pas d'URLs à crawler pour le moment", état temporaire normal. Un 404 signale "ce sitemap n'existe pas", ce qui peut déclencher des erreurs dans Search Console si le sitemap est référencé dans robots.txt.
Le 304 aveugle affecte-t-il aussi les ressources statiques CSS et JS ?
Google ne détaille pas explicitement ce point. En pratique, un 304 aveugle sur une ressource critique peut empêcher le rendering complet de la page, ce qui affecte indirectement l'indexation du contenu visible. Mieux vaut appliquer la même règle partout.
🏷 Related Topics
Content Crawl & Indexing HTTPS & Security AI & SEO 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.