You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ez...@apache.org on 2021/03/04 22:33:27 UTC
[trafficserver] branch master updated: Add a check for compress
response, if from server and 304,
then check cache for headers instead of the 304 response (#7564)
This is an automated email from the ASF dual-hosted git repository.
eze pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new b1a5cbd Add a check for compress response, if from server and 304, then check cache for headers instead of the 304 response (#7564)
b1a5cbd is described below
commit b1a5cbd8e46b3dbffa7fb73bf6c100b84cbee239
Author: Evan Zelkowitz <ez...@apache.org>
AuthorDate: Thu Mar 4 14:33:12 2021 -0800
Add a check for compress response, if from server and 304, then check cache for headers instead of the 304 response (#7564)
---
plugins/compress/compress.cc | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/plugins/compress/compress.cc b/plugins/compress/compress.cc
index f0b1d8a..13e5f97 100644
--- a/plugins/compress/compress.cc
+++ b/plugins/compress/compress.cc
@@ -657,6 +657,16 @@ transformable(TSHttpTxn txnp, bool server, HostConfiguration *host_configuration
return 0;
}
+ // We got a server response but it was a 304
+ // we need to update our data to come from cache instead of
+ // the 304 response which does not need to include all headers
+ if ((server) && (resp_status == TS_HTTP_STATUS_NOT_MODIFIED)) {
+ TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+ if (TS_SUCCESS != TSHttpTxnCachedRespGet(txnp, &bufp, &hdr_loc)) {
+ return 0;
+ }
+ }
+
if (TS_SUCCESS != TSHttpTxnClientReqGet(txnp, &cbuf, &chdr)) {
info("cound not get client request");
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);