Repository navigation
Closed
Labels
Description
https://docs.trafficserver.apache.org/en/7.1.x/admin-guide/files/records.config.en.html#proxy-config-http-negative-caching-enabled
says, "The following negative responses are cached by Traffic Server:" followed by a list of specific status codes. This is incorrect.
- the list doesn't completely match the code: For instance,
trafficserver/proxy/http/HttpTransact.cc
Lines 243 to 254 in 469ccb4
case HTTP_STATUS_NO_CONTENT: case HTTP_STATUS_USE_PROXY: case HTTP_STATUS_BAD_REQUEST: case HTTP_STATUS_FORBIDDEN: case HTTP_STATUS_NOT_FOUND: case HTTP_STATUS_METHOD_NOT_ALLOWED: case HTTP_STATUS_REQUEST_URI_TOO_LONG: case HTTP_STATUS_INTERNAL_SERVER_ERROR: case HTTP_STATUS_NOT_IMPLEMENTED: case HTTP_STATUS_BAD_GATEWAY: case HTTP_STATUS_SERVICE_UNAVAILABLE: case HTTP_STATUS_GATEWAY_TIMEOUT: case HTTP_STATUS_REQUEST_URI_TOO_LONGis status code 414. which isn't listed - non-listed 4xx errors are cached based on
proxy.config.http.cache.heuristic_min_lifetime, which defaults to 1hour.
(remap.config maps http://httpbin.org to a local instance of httpbin)
$ traffic_ctl config get proxy.config.http.negative_caching_lifetime
proxy.config.http.negative_caching_lifetime: 10
$ for status in `seq 400 499`; do
echo "####status code=$status####";
for retry in `seq 3`; do
result=$(curl -sD- -o/dev/null -x 127.0.0.1:80 "http://httpbin.org/status/$status" | egrep "(Age|X-Cache)");
if [[ $retry < 3 ]]; then
sleep 6;
else if [[ "$result" == *"Age: 0"* ]]; then
echo "$status code works";
else
echo "$status is cached too long";
fi;
fi;
done;
done
####status code=400####
400 code works
####status code=401####
401 code works
####status code=402####
402 is cached too long
####status code=403####
403 is cached too long
####status code=404####
404 code works
####status code=405####
405 code works
####status code=406####
406 is cached too long
####status code=407####
407 is cached too long
####status code=408####
408 is cached too long
####status code=409####
409 is cached too long
####status code=410####
410 is cached too long
####status code=411####
411 is cached too long
####status code=412####
412 is cached too long
####status code=413####
413 is cached too long
####status code=414####
414 code works
####status code=415####
415 is cached too long
####status code=416####
416 code works
####status code=417####
417 is cached too long
####status code=418####
418 is cached too long
####status code=419####
419 is cached too long
####status code=420####
420 is cached too long
####status code=421####
421 is cached too long
####status code=422####
422 is cached too long
####status code=423####
423 is cached too long
####status code=424####
424 is cached too long
####status code=425####
425 is cached too long
####status code=426####
426 is cached too long
####status code=427####
427 is cached too long
####status code=428####
428 is cached too long
####status code=429####
429 is cached too long
####status code=430####
430 is cached too long
####status code=431####
431 is cached too long
####status code=432####
432 is cached too long
####status code=433####
433 is cached too long
####status code=434####
434 is cached too long
####status code=435####
435 is cached too long
####status code=436####
436 is cached too long
####status code=437####
437 is cached too long
####status code=438####
438 is cached too long
####status code=439####
439 is cached too long
####status code=440####
440 is cached too long
####status code=441####
441 is cached too long
####status code=442####
442 is cached too long
####status code=443####
443 is cached too long
####status code=444####
444 is cached too long
####status code=445####
445 is cached too long
####status code=446####
446 is cached too long
####status code=447####
447 is cached too long
####status code=448####
448 is cached too long
####status code=449####
449 is cached too long
####status code=450####
450 is cached too long
####status code=451####
451 is cached too long
####status code=452####
452 is cached too long
####status code=453####
453 is cached too long
####status code=454####
454 is cached too long
####status code=455####
455 is cached too long
####status code=456####
456 is cached too long
####status code=457####
457 is cached too long
####status code=458####
458 is cached too long
####status code=459####
459 is cached too long
####status code=460####
460 is cached too long
####status code=461####
461 is cached too long
####status code=462####
462 is cached too long
####status code=463####
463 is cached too long
####status code=464####
464 is cached too long
####status code=465####
465 is cached too long
####status code=466####
466 is cached too long
####status code=467####
467 is cached too long
####status code=468####
468 is cached too long
####status code=469####
469 is cached too long
####status code=470####
470 is cached too long
####status code=471####
471 is cached too long
####status code=472####
472 is cached too long
####status code=473####
473 is cached too long
####status code=474####
474 is cached too long
####status code=475####
475 is cached too long
####status code=476####
476 is cached too long
####status code=477####
477 is cached too long
####status code=478####
478 is cached too long
####status code=479####
479 is cached too long
####status code=480####
480 is cached too long
####status code=481####
481 is cached too long
####status code=482####
482 is cached too long
####status code=483####
483 is cached too long
####status code=484####
484 is cached too long
####status code=485####
485 is cached too long
####status code=486####
486 is cached too long
####status code=487####
487 is cached too long
####status code=488####
488 is cached too long
####status code=489####
489 is cached too long
####status code=490####
490 is cached too long
####status code=491####
491 is cached too long
####status code=492####
492 is cached too long
####status code=493####
493 is cached too long
####status code=494####
494 is cached too long
####status code=495####
495 is cached too long
####status code=496####
496 is cached too long
####status code=497####
497 is cached too long
####status code=498####
498 is cached too long
####status code=499####
499 is cached too long
Activity
zwoop commentedon Mar 2, 2018
What's even stranger is that we have our setting set to require a Expires / CC: max-age header, so it really shouldn't be using the heuristics settings IMO.
mlibbey commentedon Mar 2, 2018
Update... modified the script to show that the heuristic is taking over, even though its "off" (
proxy.config.http.cache.required_headers: 2)
SolidWallOfCode commentedon Jun 29, 2018
I thought we had a patch that enabled listing the status codes to which negative caching applied, but I can't find it now. Will look around some more.
SolidWallOfCode commentedon Jul 10, 2018
It was #2031 - it was closed and never brought back. I need to fix that.
nqyy commentedon Jul 18, 2018
Fixed in commit 4c34cbc.
bryancall commentedon May 23, 2019
Looks like this has been fixed. Please reopen if there is still an issue.