Page MenuHomePhabricator

ATS: Add the ability to check if origin server responses can be cached and their lifetime to the Lua plugin
Closed, ResolvedPublic

Description

We need to be able to (a) distinguish between cacheable and uncacheable responses in Lua, and (b) know the object lifetime as calculated by ATS. See for instance T250815. The proper methods are currently not implemented upstream, so we need to add them. This task tracks the progress of implementing the changes, getting them merged upstream, and backported to our packages.

I have opened https://github.com/apache/trafficserver/pull/6726 which takes care of (a) and https://github.com/apache/trafficserver/pull/6730 taking care of part of (b), namely adding the method to the trafficserver API. The same method will have to be exposed via tslua too.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 593735 had a related patch set uploaded (by Ema; owner: Ema):
[operations/puppet@production] ATS: add SystemTap probe for cacheable responses

https://gerrit.wikimedia.org/r/593735

Change 593735 merged by Ema:
[operations/puppet@production] ATS: add SystemTap probe for cacheable responses

https://gerrit.wikimedia.org/r/593735

ema triaged this task as Medium priority.May 4 2020, 4:08 PM
ema updated the task description. (Show Details)

The PR adding a function to the TS API for getting maxage was merged yesterday. Now it just needs to be made accessible via tslua, then we're done: https://github.com/apache/trafficserver/pull/6767

Change 596160 had a related patch set uploaded (by Ema; owner: Ema):
[operations/debs/trafficserver@master] Backport patches adding ts.server_response.get_maxage()

https://gerrit.wikimedia.org/r/596160

Change 596160 merged by Ema:
[operations/debs/trafficserver@master] Release 8.0.7-1wm5

https://gerrit.wikimedia.org/r/596160

Mentioned in SAL (#wikimedia-operations) [2020-05-13T14:35:19Z] <vgutierrez> upload trafficserver 8.0.7-1wm6 to apt.wm.o (buster) - T249335 T251537

Change 595877 had a related patch set uploaded (by Ema; owner: Ema):
[operations/puppet@production] ATS: cap TTL for cacheable 404 responses to 10 minutes

https://gerrit.wikimedia.org/r/595877

That's been merged upstream too and backported to our packages in 8.0.7-1wm5.

Change 595877 merged by Ema:
[operations/puppet@production] ATS: cap TTL for cacheable 404 responses to 10 minutes

https://gerrit.wikimedia.org/r/595877

ema claimed this task.

Done, 404 TTL capping now in place:

root@cp3050:~# timeout 1 atslog-backend RespStatus:404 | egrep -o 'BerespHeader:Cache-Control:s-maxage=[0-9]+'
BerespHeader:Cache-Control:s-maxage=600
BerespHeader:Cache-Control:s-maxage=600
BerespHeader:Cache-Control:s-maxage=600
BerespHeader:Cache-Control:s-maxage=10
BerespHeader:Cache-Control:s-maxage=600
BerespHeader:Cache-Control:s-maxage=600
BerespHeader:Cache-Control:s-maxage=600
BerespHeader:Cache-Control:s-maxage=300
BerespHeader:Cache-Control:s-maxage=600