[
https://issues.apache.org/jira/browse/TS-4946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15567752#comment-15567752
]
James Fang edited comment on TS-4946 at 10/12/16 6:34 AM:
----------------------------------------------------------
{code}
7988 // If the response is prohibited from containing a body,
7989 // we know the content length is trustable for keep-alive
7990 if (is_response_body_precluded(status_code, s->method)) {
7991 s->hdr_info.trust_response_cl = true;
7992 s->hdr_info.response_content_length = 0;
7993 s->client_info.transfer_encoding =
HttpTransact::NO_TRANSFER_ENCODING;
7994 s->server_info.transfer_encoding =
HttpTransact::NO_TRANSFER_ENCODING;
7995 }
{code}
seems the above code from HttpTransact::build_response reset
response_content_length to 0,
it cause server_transfer_init called in line HttpTransact.cc:6444 return 0.
the tunnel has no data to write, then cache write is skipped.
was (Author: jamesf):
{quote}
7988 // If the response is prohibited from containing a body,
7989 // we know the content length is trustable for keep-alive
7990 if (is_response_body_precluded(status_code, s->method)) {
7991 s->hdr_info.trust_response_cl = true;
7992 s->hdr_info.response_content_length = 0;
7993 s->client_info.transfer_encoding =
HttpTransact::NO_TRANSFER_ENCODING;
7994 s->server_info.transfer_encoding =
HttpTransact::NO_TRANSFER_ENCODING;
7995 }
{quote}
seems the above code from HttpTransact::build_response reset
response_content_length to 0,
it cause server_transfer_init called in line HttpTransact.cc:6444 return 0.
the tunnel has no data to write, then cache write is skipped.
> ts remove conditional request header for os request, and does't not cache 200
> response
> --------------------------------------------------------------------------------------
>
> Key: TS-4946
> URL: https://issues.apache.org/jira/browse/TS-4946
> Project: Traffic Server
> Issue Type: Bug
> Components: Cache
> Reporter: James Fang
>
> when client send conditional request, and the item doesn't in cache
> ts seems to remove conditional request headers, and send normal request to
> original server.
> when original server response with 200, ts doesn't cache the result.
> is this the expected behaviour ?
> i think we should either send conditional request to os or cache 200 response.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)