SoupCache cacheability test doesn’t evaluate Vary header
@da
Submitted by Daniel Aleksandersen Assigned to libsoup-maint@gnome.bugs
Link to original bug (#792224)
Description
When a cache receives a request that can be satisfied by a stored response that has a Vary header field (Section 7.1.4 of [RFC7231]), it MUST NOT use that response unless all of the selecting header fields nominated by the Vary header field match in both the original request (i.e., that associated with the stored response), and the presented request.
https://tools.ietf.org/html/rfc7234#section-4.1
Here is an example scenario demonstrating this where Response 1 can only be served from the cache in response to request D. Request B and C should be cached separately.
Initial request: GET /example Accept-Language: en
Response 1: HTTP/1.1 200 OK Vary: Accept-Language
Request B: GET /example Accept-Language: de
Request C: GET /example
Request D: GET /example Accept-Language: en