Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Vary header cache #298
First try on an implementation to support vary header as asked for in
Do not merge.
I haven't written tests yet, as I am not sure, if the code is going in the right direction.
The idea at the moment is to store two entries in the cache, when a vary header is found in the response headers. One entry for the original url with the name of the vary header set and one entry for the url+var-header-name+vary-header-value (of the request).
The code makes it clearer, that the two http samplers with slightly different implementation details make it harder to implement this. For example both samplers have different notions of how the headers are implemented.
First of all - thanks for this initiative. Also I appreciate the refactorings made, project needs them a lot.
One thing that I see is not sufficient is lack of multi-header handling for Vary. RFC allows that and I saw real servers working like that (https://tools.ietf.org/html/rfc7231#section-7.1.4).
IMO implementation has to use all of headers listed in Vary as part of cache entry key.
And yes, we need unit tests to see how it all will behave as integral.
I'm not sure on the functional side of the feature, however there is a couple of performance-wise issues.
Thanks Felix for PR.
I'd just change a bit in HTTPJavaImpl#getHeaders(HeaderManager headerManager) to: