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.
If-Modified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
Directives: This header accept eight directive as mentioned above and described below:
- <day name>: It contains the day’s name like “Mon”, “Tue” etc.(case-sensitive).
- <day>: It contains the date in 2 digit numbers, like “04” or “23” for days.
- <month>: It contains the name of the month, in 3 letter month names like “Jan”, “Feb” etc.(case-sensitive).
- <year>: It contains the 4 digit year like “2020”
- <hour>: It contains the hour in 2 digit hour like “07” or “12”.
- <minute>: Same as hour minutes 2 digit minute like “09” or “55”
- <second>: Containing the seconds in 2 digits second like “08” or “50”.
- GMT: All the dates in HTTP will show in Greenwich Mean Time format, not in local time format.
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:
- Google Chrome
- Internet Explorer
- HTTP headers | Access-Control-Expose-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | Access-Control-Request-Headers
- HTTP headers | Location
- HTTP headers | User-Agent
- HTTP headers | Link
- HTTP headers | Save-Data
- HTTP headers | Content-Type
- HTTP headers | X-Forwarded-Proto
- HTTP headers | X-XSS-Protection
- HTTP headers | X-Frame-Options
- HTTP headers | Last-Modified
- HTTP headers | Date
- HTTP headers | Cookie
- HTTP headers | Strict-Transport-Security
- HTTP headers | Expect
- HTTP headers | Accept-Encoding
- HTTP headers | Proxy-Authenticate
- HTTP headers | Content-Range
- HTTP headers | Content-Encoding