The Last-Modified header is an HTTP response header that indicates the date and time when the server believes the resource was last changed. It is commonly used for browser caching and conditional requests, helping reduce bandwidth and improve site performance.
When a client requests a page, the server may respond with:
Here:
Last-Modified: Sun, 18 Aug 2024 16:45:00 GMT tells the browser the file was last updated at that time.
On the next request, the browser can send If-Modified-Since: Sun, 18 Aug 2024 16:45:00 GMT.
If the file hasn’t changed, the server replies with 304 Not Modified, saving bandwidth.
Improves loading speed for repeat visitors.
Reduces unnecessary data transfer.
Plays a key role in SEO performance by signaling freshness of content.
The Last-Modified header is a simple but powerful caching mechanism. By sending it correctly, servers help browsers and search engines understand when a resource has changed, leading to faster websites and lower server load.