Bug 64406

Summary: HTTP CacheManager - add option to check all headers
Product: JMeter Reporter: geert.draelants
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 5.2.1   
Target Milestone: JMETER_5.3.0   
Hardware: All   
OS: All   

Description geert.draelants 2020-05-03 10:45:44 UTC
The HTTP CacheManager only checks the last occurrence of Cache-Control and Expires header. So if you have a malfunctioning webserver that sends multiple contradicting headers you might not always detect it with JMeter.

Also the CacheManager does not have support for the Pragma header. Yes, this last one is deprecated with HTTP 1.1 but we've found that e.g. IE 11 still processes it. 

I would like to add support for 2 things:
(1) add an option to process all Cache-Control and Expires headers and not just the last one in the list
This would also enable 'strict' processing of the headers. By this I mean that if multiple contradicting instructions are found then we should favour the one that results on no caching or the shortest amount of caching.
E.g. if you get a header like 'Cache-Control: max-age=86400, max-age=100' then choose 'max-age=100'. Similar if multiple Expires headers are found, take the one that is the earliest to expire.

(3) add an option to process 'Pragma: no-cache' header as if it were 'Cache-Control: no-cache', regardless of the HTTP version.