You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Emanuele Rocca <em...@wikimedia.org> on 2020/05/01 17:40:39 UTC

[API] Expose origin server response max age

Hi,

the API currently allows to find out whether a given origin server
response can be cached or not by means of TSHttpTxnIsCacheable. In
certain scenarios it can be useful to also know what the object maximum
age specified by the origin is.

To make that possible I have factored the max-age logic out of
HttpTransact::calculate_document_freshness_limit and moved it to another
function called HttpTransact::get_max_age. I propose we expose the
latter as a new API function called TSHttpTxnGetMaxAge:
https://github.com/apache/trafficserver/pull/6730

Let me know what you think!

  Emanuele