<div dir="ltr"><div>Hi,</div><div><br></div><div>Probably, me missing on something silly or it can't be done but I don't know why but squid won't
return the cached version even when I turn all override options ON in
refresh_pattern. It's an API call where we call many of the same
requests and by knowing it we would like to stop those calls to go out
if it's already been sent once.</div><div><span style="font-family:monospace">With debug, I can see the rule is matched and the cache is fresh but still in access.log is TCP_REFRESH_MODIFIED</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">squid conf:</span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">refresh_pattern
-i <URL> 4320 80% 129600 override-lastmod override-expire
ignore-reload ignore-no-store ignore-private store-stale</span></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">curl headers:</span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">curl --insecure --verbose --request GET --url 'URL</span>' >/dev/null
<br>* TCP_NODELAY set
<br>* ALPN, offering h2
<br>* ALPN, offering http/1.1
<br>* successfully set certificate verify locations:
<br>* CAfile: /etc/ssl/certs/ca-certificates.crt
<br> CApath: /etc/ssl/certs
<br>} [5 bytes data]
<br>* TLSv1.3 (OUT), TLS handshake, Client hello (1):
<br>} [512 bytes data]
<br>* TLSv1.3 (IN), TLS handshake, Server hello (2):
<br>{ [122 bytes data]
<br>* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
<br>{ [6 bytes data]
<br>* TLSv1.3 (IN), TLS handshake, Certificate (11):
<br>{ [1956 bytes data]
<br>* TLSv1.3 (IN), TLS handshake, CERT verify (15):
<br>{ [78 bytes data]
<br>* TLSv1.3 (IN), TLS handshake, Finished (20):
<br>{ [52 bytes data]
<br>* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
<br>} [1 bytes data]
<br>* TLSv1.3 (OUT), TLS handshake, Finished (20):
<br>} [52 bytes data]
<br>* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
<br><br>> GET URL HTTP/1.1
<br>> Host: URL<br>> User-Agent: curl/7.68.0
<br>> Accept: */*
<br>>
<br>{ [5 bytes data]
<br>* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
<br>{ [217 bytes data]
<br>* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
<br>{ [217 bytes data]
<br>* old SSL session ID is stale, removing
<br>{ [5 bytes data]
<br>* Mark bundle as not supporting multiuse
<br>< HTTP/1.1 200 OK
<br>< Cache-Control: no-cache
<br>< Content-Type: application/json
<br>< X-Cloud-Trace-Context: d3c27833b8b4312ce31a2dbae7e12fd0
<br>< Date: Wed, 24 Mar 2021 15:04:34 GMT
<br>< Server: Google Frontend
<br>< Content-Length: 7950
<br>< X-Cache: MISS from server<br>< X-Cache-Lookup: HIT from server<br>< Via: 1.1 server (squid/4.14)
<br>< Connection: keep-alive
<br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">access log:</span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">243 172.16.230.249 TCP_REFRESH_MODIFIED/200 8328 GET URL -
ORIGINAL_DST/IP application/json</span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">cache log:</span></span></div><div><table id="gmail-m_1284902802012111177gmail-grid-log"><tbody><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710
kid1| 11,3| http.cc(982) haveParsedReplyHeaders: decided: cache
positively and share because refresh check returned cacheable; HTTP
status 200 e:=p2V/0x34868914670*3</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(470) refreshCheck: returning FRESH_MIN_RULE</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(455) refreshCheck: Object isn't stale..</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(327) refreshCheck: Staleness = -1</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(199) refreshStaleness: FRESH: age (60 sec) is less than configured minimum (259200 sec)</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(166) refreshStaleness: No explicit expiry given, using heuristics to determine freshness</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(307) refreshCheck: entry->timestamp: Wed, 24 Mar 2021 15:04:34 GMT</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(305) refreshCheck: check_time: Wed, 24 Mar 2021 15:05:34 GMT</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(303) refreshCheck: age: 60</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710 kid1| 22,3| refresh.cc(301) refreshCheck: Matched 'URL 259200 80%% 7776000'</td><td style="width:2em"> </td></tr><tr><td style="width:11em">2021-03-24T15:04:34</td><td style="width:2em">squid</td><td>.710
kid1| 22,3| refresh.cc(279) refreshCheck: checking freshness of URI:
<a href="https://URL" target="_blank">https://URL</a></td></tr></tbody></table></div></div>