-
Bug
-
Resolution: Done
-
Major
-
3.0.19.Final
-
None
The ServerCache enabled by the ServerCacheFeature does not respect the Vary header, which tells the headers that may modify the response for the same URI. E.g., this is a correct request/response exchange:
GET /hello HTTP/1.1 Accept: text/plain Accept-Language: en HTTP/1.1 200 OK Cache-Control: max-age=60 Content-Type: text/plain Vary: Accept Vary: Accept-Language Hello! GET /hello HTTP/1.1 Accept: text/plain Accept-Language: it HTTP/1.1 200 OK Cache-Control: max-age=60 Content-Type: text/plain Vary: Accept Vary: Accept-Language Ciao!
With the ServerCacheFeature, the last response would contain Hello! (i.e. cached from the previous request), instead of Ciao!.
When caching responses, the ServerCache should use all Vary headers in it and use them to match possible cached results.