Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ul> <li>It's not quite correct. Please take a look at the algorithm: <a href="http://img532.imageshack.us/img532/1017/cache.png" rel="noreferrer">alt text http://img532.imageshack.us/img532/1017/cache.png</a></li> <li>The solution is proxy-friendly, you may use Cache-control: proxy-revalidate to force caches to obey any freshness information you give them about a resource (only applies to shared|proxy caches)</li> </ul> <p>Here is the function that might help:</p> <pre><code>function isModified($mtime, $etag) { return !( ( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &amp;&amp; strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) &gt;= $mtime ) || ( isset($_SERVER['HTTP_IF_NONE_MATCH']) &amp;&amp; $_SERVER['HTTP_IF_NONE_MATCH'] == $etag ) ) ; } </code></pre> <p>I suggest that you take a look at the following article: <a href="http://www.peej.co.uk/articles/http-caching.html" rel="noreferrer">http://www.peej.co.uk/articles/http-caching.html</a></p> <p><strong>Update:</strong></p> <blockquote> <p><strong>[AlexV]</strong> Is is even possible to receive if-none-match AND if-modified-since at the same time?</p> </blockquote> <p>You can definitely have both set. However: </p> <blockquote> <p>If none of the entity tags match, then the server MAY perform the requested method as if the If-None-Match header field did not exist, but MUST also ignore any If-Modified-Since header field(s) in the request. That is, if no entity tags match, then the server MUST NOT return a 304 (Not Modified) response.</p> <p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26" rel="noreferrer">RFC2616 #14.26</a></p> </blockquote> <p>Example values (W stands for 'weak'; read more in <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.3" rel="noreferrer">RFC2616 #13.3.3</a>):</p> <pre><code>If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz" If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT If-None-Match: * </code></pre> <p>As a special case, the value "*" matches any current entity of the resource.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload