"Cache-Control" header and "Age" header are removed by ESI module
- Dominant language
- C++
- Stars
- 2k
- Forks
- 874
- Avg merge
- 6d 15h
- Merged PRs (30d)
- 46
Description
### Version:
ATS 9.2.0
### Reproduction
Master Document Header:
X-Esi: 1
etag: W/"xxxxx"
content-type: text/html; charset=UTF-8
Cache-Control: max-age=30
ESI sub-document 1 header:
cache-control: public, max-age=30
content-type: text/html; charset=UTF-8
etag: W/"XXXXXX"
ESI sub-document 2 header:
cache-control: public, max-age=30
content-type: text/html; charset=UTF-8
etag: W/"XXXXXX"
### Final Output header:
content-type: text/html; charset=UTF-8
etag: W/"XXXXXX"
X-Cache-Status: UPDATED
request after 10s
content-type: text/html; charset=UTF-8
etag: W/"XXXXXX"
X-Cache-Status: HIT
so, the caching seem work internally. but the headers are removed.
====
The "Cache-Control" header and "Age" header are removed by ESI module
### Expected Results
Final Output header:
content-type: text/html; charset=UTF-8
etag: W/"XXXXXX"
cache-control: public, max-age=30
Age: 0
and, if request after 10s
content-type: text/html; charset=UTF-8
etag: W/"XXXXXX"
cache-control: public, max-age=30
Age: 10
The cahe control / Age header should be keep to let upper layer / client cache work.
Here are some code about the max-age header calculation, need addition config to make it take effect ?
https://github.com/apache/trafficserver/blob/0e9ff8271811a46b46825fe22a272347b64df078/plugins/esi/combo_handler.cc#L266
Contributor guide
Assessment
This issue has not been assessed yet.