An ETag is a response header that labels one version of a page, so HTTP caching can tell whether a copy is still current; Last-Modified is a header that gives the date that version changed. Both are called validators, because a client can hand one back later and ask whether its copy still holds.
A scraper that keeps pages has the same question a browser cache has: is the copy I saved still the page the site serves? The two validators are the site's own answer, when it gives one. This page explains what each one is, then shows which of ten public documentation pages sent them on one day. It stops short of using them. Sending a validator back is a conditional request, and that is a separate step. For where this fits in the wider job, start at the web scraping guide.
What an ETag is
The standard for HTTP, RFC 9110, defines it this way: "An entity tag is an opaque validator for differentiating between multiple representations of the same resource". A representation is one version of a page as the server sent it. If the page changes, the tag changes.
The important word is opaque. The value is a quoted string the server picks, and the client is not meant to read meaning into it. The same section says "Since the value is opaque, there is no need for the client to be aware of how each entity tag is constructed." MDN lists the usual sources: "Typically, the ETag value is a hash of the content, a hash of the last modification timestamp, or just a revision number." A scraper stores the string as it came and compares it whole.
This clip reads a strong and a weak tag from two real responses, then compares a stored tag with a new one.
Read the transcript
What an ETag is. A server's label for one version of a page.
Two response headers label a version: ETag, and the date in Last-Modified. The request reads: GET /3/library/pathlib.html. Host: docs.python.org. The response reads: 200 OK. ETag: "6b019b69-42381". Last-Modified: Sat, 21 Nov 2026 13:23:53 GMT. ETag is read: strong tag. Last-Modified is read: date of this version. strong ETag: same tag: the bytes are the same. 21 Nov 2026: the date the server has for it.
A tag that starts with W/ is weak. The W/ is part of the value. The request reads: GET /api/http.html. Host: nodejs.org. The response reads: 200 OK. ETag: W/"c0dfb3b741611ee2988c875eda78d198". Last-Modified: Wed, 11 Nov 2026 00:33:30 GMT. ETag is read: weak tag. weak ETag: same tag: bytes may still differ.
Store the tag as it came, then compare it whole with the next one. The response reads: 200 OK. ETag: W/"c0dfb3b741611ee2988c875eda78d198". ETag is read: weak tag. The client's stored copy reads ETag: W/"c0dfb3b741611ee2988c875eda78d198". Compared whole, character by character, the two are the same value: same meaning, bytes may differ.
Drop the W/ and the stored value no longer matches. The response reads: 200 OK. ETag: W/"c0dfb3b741611ee2988c875eda78d198". ETag is read: weak tag. The client's stored copy reads ETag: "c0dfb3b741611ee2988c875eda78d198". Compared whole, character by character, the two are not the same value: they differ at character 1.
Of 10 pages, 6 sent an ETag and 4 of those were weak. 4 sent neither. docs.python.org/3/library/pathlib.html sent a strong ETag and a Last-Modified date. developer.mozilla.org/.../Headers/ETag sent a strong ETag and a Last-Modified date. nodejs.org/api/http.html sent a weak ETag and a Last-Modified date. doc.rust-lang.org/book/ sent a weak ETag and a Last-Modified date. react.dev/learn sent a weak ETag. kubernetes.io/docs/home/ sent a weak ETag. 4 more pages are counted, not shown: they sent neither. 6 sent an ETag. 4 sent a Last-Modified date. 4 sent neither. 4 of the 6 tags are weak.
Keep the tag and compare it. Read nothing into it. A tag is opaque: ETag: W/"...". store: As it came, W/ included. parse: Never. It is opaque. none: Fetch again and compare.
Read the full page. The page is at spider.cloud/learn/etag.
Strong and weak tags
A tag that starts with W/ is weak. MDN says of them, "Weak ETags are easy to generate, but are far less useful for comparisons." A strong tag promises the bytes are the same. A weak tag promises less: two responses with the same weak tag mean the same thing, though their bytes may differ, for example by a timestamp in the footer.
The prefix is not the server's free choice. RFC 9110 says that when a tag does not meet the rules for a strong validator, "the origin server MUST mark the entity tag as weak by prefixing its opaque value" with W/, and the prefix is case sensitive. So keep the W/ when you store a tag. Strip it and you have changed the value.
What Last-Modified is
Last-Modified is a date in the usual HTTP format, such as Sat, 21 Nov 2026 13:23:53 GMT. RFC 9110 calls it a "timestamp indicating the date and time at which the origin server believes the selected representation was last modified". Note the word believes. The date is whatever the server records, which may be when the page was built, not when its text last changed.
It is also coarse. A date has one-second steps, and the RFC gives that as one reason a tag can do better: "An entity tag can be more reliable for validation than a modification date in situations where it is inconvenient to store modification dates, where the one-second resolution of HTTP-date values is not sufficient, or where modification dates are not consistently maintained." The RFC also treats a Last-Modified date as weak by default when it is used to validate.
The RFC asks servers to send both where they can. For the ETag it says "An origin server SHOULD send an ETag for any selected representation for which detection of changes can be reasonably and consistently determined". SHOULD is a recommendation, not a rule, and the run below shows how often it is followed.
Ten pages, one run
We asked for ten documentation pages in one call on 2026-11-21, at 14:58:55 UTC, and kept two response headers from each. return_headers turns on the response headers, which are off unless you ask.
curl -s https://api.spider.cloud/scrape \
-H "Authorization: Bearer $SPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://docs.python.org/3/library/pathlib.html,https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag,https://docs.github.com/en/rest,https://nodejs.org/api/http.html,https://react.dev/learn,https://doc.rust-lang.org/book/,https://kubernetes.io/docs/home/,https://docs.djangoproject.com/en/stable/,https://go.dev/doc/,https://www.postgresql.org/docs/current/", "request": "http", "return_format": "markdown", "return_headers": true}'That body is the one we sent. It carries no user_agent; add one with your bot's name and a contact address before you run it yourself. The call took 4.0 seconds, and every page answered 200. Each page's headers are in its headers field. These are the two we kept, one line per page, with - where the response had no such header.
page etag last-modified
docs.python.org/3/library/pathlib.html "6b019b69-42381" Sat, 21 Nov 2026 13:23:53 GMT
developer.mozilla.org/.../Headers/ETag "5317f13b305419f84a81f96ea68b7594" Sat, 21 Nov 2026 00:54:13 GMT
nodejs.org/api/http.html W/"c0dfb3b741611ee2988c875eda78d198" Wed, 11 Nov 2026 00:33:30 GMT
doc.rust-lang.org/book/ W/"53f412dea702d566ee85bffa6d9eb934" Thu, 12 Nov 2026 18:12:10 GMT
react.dev/learn W/"599f51be22a6407fc3c31811152900f3" -
kubernetes.io/docs/home/ W/"83a698e70cc3e146be1a18c3dca21a35-ssl" -
docs.github.com/en/rest - -
docs.djangoproject.com/en/6.1/ - -
go.dev/doc/ - -
www.postgresql.org/docs/current/ - -Two addresses came back changed. MDN moved its ETag page under /Reference/, and Django's stable link led to /en/6.1/. The table shows where each page ended up.
What the ten show
Six of the ten sent an ETag. Four of those six were weak. Four pages sent a Last-Modified date, and every one of them sent an ETag too. No page sent a date alone, and four sent neither.
So on this run, a scraper that only looked for Last-Modified would have had a validator for four pages. One that looked for either would have had six. The other four give a client nothing to hand back. For those, the only way to know whether a page changed is to fetch it again and compare what you saved, which is how incremental crawling works when a site sends no validator.
Two values are worth a closer look. The Python page's tag has two hex numbers. The first, 6b019b69, is 1795267433 in decimal, and as a Unix time that is 13:23:53 UTC on 2026-11-21, the same second as its Last-Modified date. Here the tag was built from the date, so on this page it adds little that the date does not already say. The Kubernetes tag ends in -ssl, a suffix the server added. Both are reasons the RFC calls a tag opaque. You can see a pattern in one site's tags, and the next site will use another, so code that parses a tag breaks on the next one.
The dates say less than they seem to. MDN and the Python page both carried a date from the same day as the run. That may mean the text changed that day, or only that the site rebuilt its pages. A date tells you when the server thinks the page changed. It does not tell you what changed.
This is one call on one day, to ten pages chosen because they are public docs. Another set of sites will give other counts, and the same sites may answer differently next month. Read it as a picture of how much the validators vary, not as a rate.
Do this, avoid this
Do this
- Store the ETag exactly as it came, quotes and W/ included, beside each page you keep.
- Store the Last-Modified date too, since a site may send one without the other.
- Treat a page with neither as one you can only check by fetching it again, and keep the pace you would use for any request to that site.
- Read the site's robots.txt and terms before you plan repeat visits to it.
Avoid this
- Parsing an ETag for a date, a size or a hash. It is opaque, and the next site builds it another way.
- Dropping the W/ prefix, which turns a weak tag into a different value.
- Logging a text change because the Last-Modified date moved.
- Assuming every site sends a validator. Four of ten in this run sent neither.
Read them yourself
Paste the request above with one address you are allowed to fetch, add your user_agent, and look in the headers object for etag and last-modified. The header names come back in lower case. If neither is there, that page gives you no validator, and the headers page explains what else to read on the same response: what an HTTP header is.