#1) crit (and MISS) on third curl whenever first is MISS/EXPIRED. Expecting to ALWAYS get "X-Cache: HIT /" on third curl but getting "X-Cache: MISS /"
tc1(){ curl -sSD- 127.0.0.1 -H returnVary:x -H x:1; curl -sSD- 127.0.0.1 -H xtra:x+ -H x:2; curl -sSD- 127.0.0.1 -H xtra:x+ -H x:2; }
#2) same issue as above with different Vary/headers
tc2(){ curl -sSD- 127.0.0.1 -H returnVary:x,y -H x:1 -H y:1; curl -sSD- 127.0.0.1 -H returnVary:y -H xtra:x+ -H x:2 -H y:1; curl -sSD- 127.0.0.1 -H returnVary:y -H xtra:x+ -H x:2 -H y:1; }

#3) like 1) but everything works as expected as response headers on second/third curl's are not larger
tc3(){ curl -sSD- 127.0.0.1 -H returnVary:x -H x:1; curl -sSD- 127.0.0.1 -H xtra:x -H x:2; curl -sSD- 127.0.0.1 -H xtra:x -H x:2; }
#4) like 2) but everything works as expected as response headers on second/third curl's are not larger
tc4(){ curl -sSD- 127.0.0.1 -H returnVary:x,y -H x:1 -H y:1; curl -sSD- 127.0.0.1 -H returnVary:y -H x:2 -H y:1; curl -sSD- 127.0.0.1 -H returnVary:y -H x:2 -H y:1; }

#5) slight change from 2) but also works as expected probably because the first curl will never "match" the cache entry from the third call
tc5(){ curl -sSD- 127.0.0.1 -H returnVary:x,y -H x:1 -H y:1; curl -sSD- 127.0.0.1 -H returnVary:x -H xtra:x -H x:2 -H y:1; curl -sSD- 127.0.0.1 -H returnVary:x -H xtra:x -H x:2 -H y:1; }

#6) a couple of test cases more where issue happens: if 5) executed after 3) or 4) when cache entry is expired it will error
tc3_5(){ tc3; sleep 6; tc5; }
tc4_5(){ tc4; sleep 6; tc5; }

#util loop function
loop(){ local t=${2:-4} i=0; while [ $((i++)) -lt $t ]; do [ $i -eq 1 ] || sleep ${3:-3}; echo "=====  LOOP $i/$t  ====="; eval "$1"; done; }
