Open In App

HTTP headers | If-Modified-Since

The If-Modified-Since header is a request-header that is sent to a server as a conditional request. If the contents have changed, the server responds with a 200 status code and the entire requested document is updated. The If-Modified-Since HTTP header indicates the time for which a browser first downloaded a resource from the server. This helps to determine whether the resource has changed or not, since the last time it was accessed. If the status of a particular resource is 304 Not Modified, this means that the file has not changed and there is no need to download it again.

Let us take an example of this website i.e. GeeksforGeeks, it has different pages about computer science subjects. Whenever a search engine visits this website, it will check each page of the website and if none of the pages have changed, it will not load any of those pages. But if there is a change in any one of its pages, a flag will raise. So when the search engine visits, it will see the flag for the changed page, and then it will access that page.



Note: When used in combination with the If-None-Match, it is ignored, unless the server does not support If-None-Match.

Syntax:



If-Modified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT

Directives: This header accept eight directive as mentioned above and described below:

Example:

If-Modified-Since: Sun, 10 May 2020 02:01:00 GMT 

Supported Browsers: The browsers supported by HTTP header If-Modified-Since header are listed below:

Article Tags :