HTTPClientPolicy CacheControl type should accept parameters for some directives
-------------------------------------------------------------------------------
Key: CXF-622
URL: https://issues.apache.org/jira/browse/CXF-622
Project: CXF
Issue Type: Improvement
Components: Configuration
Environment: NA
Reporter: Steven E. Harris
Priority: Minor
Per section 14.9 (Cache-Control) of RFC 2616 (HTTP 1.1), several of the
Cache-Control directives require a parameter to make sense.
"max-age" and "min-fresh" both require a non-negative integer parameter
specifying seconds. "max-stale" can accept a similar parameter, though it is
not required.
At present, the HTTPClientPolicy class will accept values of the
ClientCacheControlType enum, but has no way to accept these "delta seconds"
parameters. Furthermore, HTTPConduit doesn't do any special formatting in its
setHeadersByClientPolicy() method to accommodate such parameters.
I suspect these cache control directives don't get changed much, but it's worth
noting that the present interface allows invalid values to be specified,
insofar as the resulting HTTP headers don't conform to the specification.
Additionally, HTTP permits more than one directive to be specified, per the
"1#cache-directive" rule.
Of course, fixing this requires some care. It may be worth just punting and
letting the user specify the actual text of the directive, such as:
CacheControl="max-age=1000, max-stale"
Capturing that in an enum is just too difficult.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.