You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.
If an If-None-Match header field is not present, a request containing
an If-Modified-Since header field (Section 3.3 of [RFC7232])
indicates that the client wants to validate one or more of its own
stored responses by modification date. A cache recipient SHOULD
generate a 304 (Not Modified) response (using the metadata of the
selected stored response) if one of the following cases is true: 1)
the selected stored response has a Last-Modified field-value that is
earlier than or equal to the conditional timestamp; 2) no
Last-Modified field is present in the selected stored response, but
it has a Date field-value that is earlier than or equal to the
conditional timestamp; or, 3) neither Last-Modified nor Date is
present in the selected stored response, but the cache recorded it as
having been received at a time earlier than or equal to the
conditional timestamp.
On such a request, CacheRules will return a 200 with REVALIDATED as lookup value.
The text was updated successfully, but these errors were encountered:
SleeplessByte
changed the title
Revalidation only allows ETag matching, no If-Not-Modified-Since
Revalidation with matching If-Not-Modified-Since is 200 instead of 304
Jul 14, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there,
Currently, on revalidation, a 304 will only be generated if the precondition matches:
https://github.com/aw/CacheRules/blob/master/lib/validations.rb#L124-L127"
However, this does not handle all the preconditions:
https://tools.ietf.org/html/rfc7234#section-4.3.2
On such a request,
CacheRules
will return a 200 withREVALIDATED
as lookup value.The funny thing is, you have actually already written this:
https://github.com/aw/CacheRules/blob/master/lib/validations.rb#L29
A simple replacement of
validator_match
withprecond_match
here should fix this:https://github.com/aw/CacheRules/blob/master/lib/cache_rules.rb#L89
The text was updated successfully, but these errors were encountered: