In bootstrap.inc last modified headers check`s by strongest condition.
If-Modified-Since and etag headers MUST exist. And If-Modified-Since header MUST be equal to last modified ($cache->created) date.
Search engines unable to use conditional GET with such implementation which delays site recrawling speed.
See the https://tools.ietf.org/html/rfc7232#section-3.3
A recipient MUST ignore If-Modified-Since if the request contains an
If-None-Match header field; the condition in If-None-Match is
considered to be a more accurate replacement for the condition in
If-Modified-Since, and the two are only combined for the sake of
interoperating with older intermediaries that might not implement
If-None-Match.
But https://tools.ietf.org/html/rfc2616##section-13.3.4 says
An HTTP/1.1 origin server, upon receiving a conditional request that
includes both a Last-Modified date (e.g., in an If-Modified-Since or
If-Unmodified-Since header field) and one or more entity tags (e.g.,
in an If-Match, If-None-Match, or If-Range header field) as cache
validators, MUST NOT return a response status of 304 (Not Modified)
unless doing so is consistent with all of the conditional header
fields in the request.
I try to use new logic for checking content modified or not.
With this patch search engines can correctly use conditional GET queries with Last Modified and get 304 Not Modified response. This increases recrawling speed of sites with many pages.
We solved the same problem for Drupal 8 with a contrib https://www.drupal.org/project/lastmodified_since
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3055984-last-modified-headers-fix-4.patch | 2.67 KB | armrus |
Comments
Comment #2
armrus commentedComment #4
armrus commentedFix tests with new criterias.
Comment #5
sin commented