<div dir="ltr">Thanks for the explanations Amos, much appreciated.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 18 Jan 2024 at 16:24, Amos Jeffries <<a href="mailto:squid3@treenet.co.nz">squid3@treenet.co.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 19/01/24 03:53, Robin Carlisle wrote:<br>
> Hi, Hoping someone can help me with this issue that I have been <br>
> struggling with for days now. I am setting up squid on an ubuntu PC to <br>
> forward HTTPS requests to an API and an s3 bucket under my control on <br>
> amazon AWS. The reason I am setting up the proxy is two-fold...<br>
> <br>
> 1) To reduce costs from AWS.<br>
> 2) To provide content to the client on the ubuntu PC if there is a <br>
> networking issue somewhere in between the ubuntu PC and AWS.<br>
> <br>
> Item 1 is going well so far. Item 2 is not going well. Setup details ...<br>
> <br>
...<br>
<br>
> <br>
> When network connectivity is BAD, I get errors and a cache MISS. In <br>
> this test case I unplugged the ethernet cable from the back on the <br>
> ubuntu-pc ...<br>
> <br>
> *# /var/log/squid/access.log*<br>
> 1705588717.420 11 127.0.0.1 NONE_NONE/200 0 CONNECT <br>
> <a href="http://stuff.amazonaws.com:443" rel="noreferrer" target="_blank">stuff.amazonaws.com:443</a> <<a href="http://stuff.amazonaws.com:443" rel="noreferrer" target="_blank">http://stuff.amazonaws.com:443</a>> - <br>
> HIER_DIRECT/<a href="http://3.135.162.228" rel="noreferrer" target="_blank">3.135.162.228</a> <<a href="http://3.135.162.228" rel="noreferrer" target="_blank">http://3.135.162.228</a>> -<br>
> 1705588717.420 0 127.0.0.1 NONE_NONE/503 4087 GET <br>
> <a href="https://stuff.amazonaws.com/api/v1/stuff/stuff.json" rel="noreferrer" target="_blank">https://stuff.amazonaws.com/api/v1/stuff/stuff.json</a> <br>
> <<a href="https://stuff.amazonaws.com/api/v1/stuff/stuff.json" rel="noreferrer" target="_blank">https://stuff.amazonaws.com/api/v1/stuff/stuff.json</a>> - HIER_NONE/- <br>
> text/html<br>
> <br>
> *# extract from /usr/bin/proxy-test output*<br>
> < HTTP/1.1 503 Service Unavailable<br>
> < Server: squid/5.7<br>
> < Mime-Version: 1.0<br>
> < Date: Thu, 18 Jan 2024 14:38:37 GMT<br>
> < Content-Type: text/html;charset=utf-8<br>
> < Content-Length: 3692<br>
> < X-Squid-Error: ERR_CONNECT_FAIL 101<br>
> < Vary: Accept-Language<br>
> < Content-Language: en<br>
> < X-Cache: MISS from ubuntu-pc<br>
> < X-Cache-Lookup: NONE from ubuntu-pc:3129<br>
> < Via: 1.1 ubuntu-pc (squid/5.7)<br>
> < Connection: close<br>
> <br>
> I have also seen it error in a different way with a 502 but with the <br>
> same ultimate result.<br>
> <br>
> My expectation/hope is that squid would return the cached object on any <br>
> network failure in between ubuntu-pc and the AWS endpoint - and continue <br>
> to return this cached object forever. Is this something squid can do? <br>
> It would seem that offline_mode should do this?<br>
> <br>
<br>
<br>
FYI, offline_mode is not a guarantee that a URL will always HIT. It is <br>
simply a form of "greedy" caching - where Squid will take actions to <br>
ensure that full-size objects are fetched whenever it lacks one, and <br>
serve things as stale HITs when a) it is not specifically prohibited, <br>
and b) a refresh/fetch is not working.<br>
<br>
<br>
The URL you are testing with should meet your expected behaviour due to <br>
the "Cache-Control: public, stale-of-error" header alone.<br>
Regardless of offline_mode configuration.<br>
<br>
<br>
That said, getting a 5xx response when there is an object already in <br>
cache seems like something is buggy to me.<br>
<br>
A high level cache.log will be needed to figure out what is going on <br>
(see <a href="https://wiki.squid-cache.org/SquidFaq/BugReporting#full-debug-output" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/SquidFaq/BugReporting#full-debug-output</a>).<br>
Be aware this list does not permit large posts so please provide a link <br>
to download in your reply not attachment.<br>
<br>
<br>
Cheers<br>
Amos<br>
_______________________________________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org" target="_blank">squid-users@lists.squid-cache.org</a><br>
<a href="https://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">https://lists.squid-cache.org/listinfo/squid-users</a><br>
</blockquote></div>