Sub topic 2
Sitemaps as a Discovery Hint
This chapter assumes you understand HTTP requests, HTML links, status codes, and short Python snippets. A sitemap helps a crawler discover URLs, but it does not guarantee crawling or indexing.
Sitemaps as a discovery hint
An XML sitemap lists important URLs on a site. It can also include metadata such as the last modification date. A site usually publishes its sitemap at a known location or submits it through search-engine tools.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/guide</loc>
<lastmod>2026-01-15</lastmod>
</url>
</urlset>A sitemap is useful for pages that are new, deeply linked, or not well connected internally. Search engines compare sitemap entries with links, robots.txt rules, server responses, and indexing signals. A sitemap cannot override a disallow rule or force a low-quality page into the index.
The crawl frontier
The crawl frontier is the crawler’s queue of URLs waiting to be fetched. The crawler adds URLs from links, sitemaps, redirects, and other discovery sources. It then prioritizes them using signals such as site importance, page freshness, update frequency, and previous fetch results.
A frontier also removes duplicates. For example, a URL fragment identifies a location within a document, not a separate page. Query parameters may identify different content, or they may create many duplicate URLs. Normalization helps the crawler make that distinction.
Politeness, rate limits, and crawl budget
Politeness means avoiding excessive load on a site. Crawlers limit request rates, respect server errors, and may pause when a site responds slowly. Crawl budget is the practical number of URLs a crawler can fetch and process for a site during a period.
Large sites should reduce duplicate URLs, provide accurate sitemaps, return useful status codes, and avoid unlimited calendar or search URLs. These practices help the crawler spend its budget on valuable pages.
> callout note > A sitemap suggests what to visit. robots.txt controls what may be fetched. They solve different problems.
Rendering JavaScript-dependent pages
Some pages contain little HTML until JavaScript runs. A crawler may first fetch the raw response, then place the page in a rendering queue. Rendering costs more resources, so it may happen later or not at all. Important content and links should therefore be present in the initial HTML when possible.
Canonical URLs and duplicate content
A canonical URL is the preferred address for substantially equivalent pages. A page can declare one with a canonical link element. Search engines use this signal with redirects, links, sitemap entries, and content similarity. Canonicalization consolidates duplicate signals, but it is a hint rather than an absolute command.
Exercise
A page appears in a sitemap but is not crawled. What should you check first?
Show answer
Check whether robots.txt blocks it, whether the URL returns a usable response, and whether crawl prioritization or budget delays it.