Last-Modified: What This HTTP Header Is, How to Configure and Check It
Brief Summary
Last-Modified is an HTTP header that tells the date when a page was last changed. It helps search crawlers save crawl budget, speeds up the indexing of updated content, and reduces server load.
In December 2024, Google updated its crawling documentation and now recommends using ETag together with Last-Modified. In this article, we break down both mechanisms and provide instructions for setup and verification.
Who should read this:
- Webmasters and site owners who want to speed up page indexing;
- SEO specialists working with technical optimization;
- Developers who configure HTTP headers and site caching.
Let's take a closer look at the Last-Modified HTTP header — why it is needed, how it affects indexing and site caching, and what a webmaster should do with it.
The Last-Modified Header — What It Is
Last-Modified is an HTTP response header from the server that contains the date and time when the page was last changed. The format looks like this:
Last-Modified: <day of week>, <day> <month name> <year> <hour>:<minute>:<second> GMT
Example:
Last-Modified: Tue, 04 Mar 2025 09:48:00 GMT
This is not a required header. But search crawlers use it during indexing to understand whether it is worth downloading the page again.
How Last-Modified and If-Modified-Since work together
When a document is requested for the first time, the server returns the page content and specifies the date of the last change in the Last-Modified HTTP header.
On a repeat visit, the bot or browser sends a request to the server with the If-Modified-Since header — asking whether the page has changed after the specified date. If it has, a new version is needed.
The server compares the dates. Then there are two possible scenarios:
- the page has changed — the server returns a 200 OK status and loads the new content, and the crawler processes the changes;
- the page has not changed — the server returns a 304 Not Modified status without loading the content. The page is taken from cache, and bots understand that re-crawling is not needed.
This mechanism works the same way in all versions of the HTTP protocol, including HTTP/2 and HTTP/3 (standardized in June 2022). Caching headers belong to the HTTP semantics layer, not the transport layer, so they do not depend on the protocol version.
FAQ on the topic
Is Last-Modified a mandatory header?
No. The server may choose not to send it, and the page will still be indexed. But without Last-Modified, search crawlers cannot determine whether the content has changed and will have to download the page from scratch every time.
What is If-Modified-Since and how is it related to Last-Modified?
If-Modified-Since is a request header that a browser or bot sends to the server. It contains the date from Last-Modified received during the previous visit. The server compares this date with the current modification date and decides whether to return new content (200 OK) or report that nothing has changed (304 Not Modified).
Does Last-Modified work with HTTP/3?
Yes. Last-Modified and If-Modified-Since work the same way in HTTP/1.1, HTTP/2, and HTTP/3, because these headers belong to HTTP semantics rather than the transport layer.
How the Last-Modified Header Helps with SEO and Indexing
Optimize crawl budget and speed up indexing
The number of pages a search bot can crawl in a single visit is limited. The Last-Modified header helps optimize a website’s crawl budget.
By using content change dates, search bots can prioritize crawling: they start with the pages where something has changed. This speeds up the indexing of new and updated content.
According to Google (December 2024), only 0.017% of crawler requests hit the cache — significantly less than ten years ago (0.026%). Google encourages website owners to configure HTTP caching more actively to reduce the load on both servers and search engines.
Show the current content date in search results
If the date is specified in the correct format, pages may be included in date-based sorting. Search engines and users prefer fresh content — there is a higher chance that the information is up to date. Google representative John Mueller also recommends specifying the dates of the latest changes.
Speed up page loading and save bandwidth
Users do not need to load the entire page every time if caching is available. Pages that have not changed since the last visit will load from the cache — saving bandwidth and improving loading speed.
Reduce server load
The server sends the user only the pages where something has been updated. For all others, it returns 304 Not Modified, and the data is taken from the cache.
This is especially important for high-traffic pages. For example, a user may be waiting for updated match results or new job listings and keeps refreshing the page. If there are many such users, the server load increases because of constant requests and page rendering. With a properly configured Last-Modified header, the server will send the page once, and after that it will respond with 304 Not Modified until the content changes.
FAQ on the topic
Does Last-Modified affect a site’s rankings in search results?
The header itself is not a ranking factor. However, it indirectly affects SEO: it helps bots find and index updated content faster, and the date shown in search results can improve the click-through rate of fresh materials.
How much crawl budget does Last-Modified save?
It depends on the size of the website. For small sites (up to a few hundred pages), the effect is minimal — the bot will crawl them entirely anyway. For large projects with thousands of pages, the savings are noticeable: the bot skips unchanged pages and spends its budget on content that has actually been updated.
Last-Modified and ETag: what Google recommends
In December 2024, Google updated its crawling documentation and added recommendations on using ETag — an alternative cache validation mechanism.
What ETag is
ETag (Entity Tag) is an HTTP header that contains a unique identifier for a specific version of a resource. It is usually a hash of the page content. It works similarly to Last-Modified, but instead of a date it uses an identifier string:
ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"
On a repeat request, the bot sends this identifier in the If-None-Match header. If the content has not changed, the server responds with 304 Not Modified.
Why Google recommends ETag
Google now recommends ETag instead of Last-Modified for several reasons:
- Accuracy. ETag is tied to the content, not the time. If two changes happen within the same second, Last-Modified will not be able to distinguish them, while ETag will.
- No date format issues. Last-Modified requires a strict format (day of the week, day, month, year, time in GMT). Formatting errors are a common reason why caching does not work. ETag does not have this problem.
- Compliance with HTTP standards. When a server returns both headers (ETag and Last-Modified), the HTTP specification says the client should use ETag. Google crawlers follow this behavior.
What to choose: ETag or Last-Modified
The best option is to use both headers at the same time. ETag provides precise validation, while Last-Modified remains a fallback mechanism for clients that do not support ETag.
For most websites running on popular CMS platforms (WordPress, Bitrix, Drupal) and web servers (Nginx, Apache), ETag is generated automatically. Check whether this feature is enabled on your hosting.
An important nuance: caching support differs across Google crawlers. The main Googlebot fully supports both ETag and Last-Modified. AdsBot more often sends If-Modified-Since. And Storebot-Google has limited caching support.
FAQ on the topic
Can you use only ETag without Last-Modified?
Yes, you can. Google will process both headers correctly. But for maximum compatibility, it is recommended to return both — some crawlers and older clients may not support ETag.
Do you need to configure ETag manually?
In most cases, no. Nginx and Apache generate ETag automatically for static files. For dynamic pages, additional configuration may be needed at the CMS or application level.
How to Set Up Last-Modified and If-Modified-Since
Before configuring this, make sure your server supports the Last-Modified header. Most modern web servers (Nginx, Apache, LiteSpeed) support it by default for static files.
Configuring via CMS plugins
Popular CMS platforms have ready-made solutions:
- WordPress — the WP Last Modified Info plugin (more than 30,000 active installations, rated 4.9). It adds the last updated date to pages, generates dateModified markup for Schema.org, and supports Gutenberg and Elementor. Clearfy and WP Super Cache are also suitable options.
- 1C-Bitrix — the cache management module is built into the system. In the main module settings, enable sending Last-Modified headers.
- Drupal — the lastmodified_since module.
In many cases, the built-in CMS caching mechanism is enough to send Last-Modified — check your system settings.
Manual setup for static pages
If your site is static, specify Last-Modified on every page with the date of the last change, and update it manually after each edit:
<meta http-equiv="Last-Modified" content="Tue, 04 Mar 2025 12:45:26 GMT">
PHP setup for dynamic pages
For a dynamic website, you can configure the Last-Modified HTTP header to be sent via PHP. Add the following code at the beginning of the script (before any HTML output):
<!--?php
$LastModified_unix = strtotime(date("D, d M Y H:i:s", filectime($_SERVER['SCRIPT_FILENAME'])));
$LastModified = gmdate("D, d M Y H:i:s \G\M\T", $LastModified_unix);
$IfModifiedSince = false;
if (isset($_ENV['HTTP_IF_MODIFIED_SINCE']))
$IfModifiedSince = strtotime(substr($_ENV['HTTP_IF_MODIFIED_SINCE'], 5));
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))
$IfModifiedSince = strtotime(substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5));
if ($IfModifiedSince && $IfModifiedSince -->= $LastModified_unix) {
header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
exit;
}
header('Last-Modified: ' . $LastModified);
?>
Let’s break down the logic:
- The first line gets the file modification time and converts it into a Unix timestamp.
- The gmdate function formats the date in the required format: day of the week, day, month, year, hours, minutes, seconds, GMT.
- Next, the script checks the If-Modified-Since header from the request. If the date matches or is newer, it returns 304 Not Modified and stops execution. If the content has changed, the server returns 200 OK and loads the page in full.
A common mistake: substituting the date with the current time
The most common mistake is using the current request time as the Last-Modified date. In this case, search bots will download every page on every visit, the crawl budget will be wasted, and indexing will slow down.
Make sure Last-Modified returns the actual content modification date, not the response generation time.
If the update date is specified incorrectly, bots will still index the page, but it will not be able to participate in date-based sorting in search results. The format is strict, and the time must be in Greenwich Mean Time (GMT):
Last-Modified: <day of week>, <day> <month name> <year> <hour>:<minute>:<second> GMT
FAQ on the topic
What happens if Last-Modified returns the wrong date?
The page will still be indexed, but it will not be able to participate in date-based sorting in search results. In addition, the caching mechanism through If-Modified-Since will stop working correctly — the bot will download the page every time.
Do I need to configure Last-Modified if I have a small website?
For websites with up to a few hundred pages, there is no urgent need — search bots will crawl them fully anyway. But the setup is still useful: users will get faster loading thanks to caching, and the search results will display the current date.
Does Last-Modified work for pages blocked in robots.txt?
No. If a page is blocked from indexing in robots.txt, the bot will not access it, and the Last-Modified header will not be processed.
How to Check Last-Modified Online
You can check whether the Last-Modified header is present and correctly configured in several ways.
PR-CY Tool
PR-CY offers a free tool that shows how a search crawler sees your page. If Last-Modified is configured, the tool will display it.

Developer Tools in the Browser
Open DevTools (F12 or Ctrl+Shift+I), go to the Network tab, refresh the page, and select the main request. In the Response Headers section, look for the Last-Modified and ETag lines. This method is convenient for a quick check without using third-party services.
Command Line (cURL)
For bulk or automated checks, it is convenient to use the cURL command:
curl -I https://example.com/page/
The command will return the server response headers, including Last-Modified and ETag (if they are configured). A 200 OK response code means the page was loaded, while 304 Not Modified means the content has not changed since the last request.
FAQ on the Topic
My server does not return Last-Modified — what should I do?
Check your web server settings (Nginx, Apache). For static files, this header is usually enabled by default. For dynamic pages, it needs to be configured through the CMS or PHP code (examples are provided above in the configuration section).
How can I check that If-Modified-Since works correctly?
Make two requests to the page using cURL. The first should be a regular one (curl -I URL). Take the Last-Modified value from the response. The second should include the If-Modified-Since header: curl -I -H "If-Modified-Since: date_from_the_first_response" URL. If the server returns 304 Not Modified, the mechanism is working. If it returns 200 OK, then If-Modified-Since handling is not configured.
In Conclusion
The Last-Modified header remains an important tool for optimizing crawl budget, speeding up indexing, and improving website caching. With Google’s documentation update in 2024, it is worth complementing it with the ETag header — this will provide the maximum effect when interacting with search crawlers.
🍪 By using this website, you agree to the processing of cookies and collection of technical data to improve website performance in accordance with our privacy policy.