apache / apache/trafficserver

"Cache-Control" header and "Age" header are removed by ESI module

Aperta
#9,596 6 commenti 0 reazioni 1 assegnatario Rivendicata da @shukitchan Vedi su GitHub
esi Plugins Stale
Lingua principale
C++
Stelle
2k
Fork
874
Merge medio
5g 11h
PR unite (30g)
56

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.