<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Gothic";
        panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Default Sans Serif";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
@font-face
        {font-family:"\@MS Gothic";
        panose-1:2 11 6 9 7 2 5 8 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.p1, li.p1, div.p1
        {mso-style-name:p1;
        margin:0cm;
        font-size:8.5pt;
        font-family:Menlo;
        color:black;}
span.s1
        {mso-style-name:s1;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Hi Alex,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">That makes a lot of sense, I don’t know how I overlooked that – thank you. I also agree, logically caching a 201 response makes little sense, and it was just an example I had that
 was easy to try so I used that. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">I just altered the HTTP Return code so it sent 200 instead of 201, and the result is sadly the same, I get many, many lines like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="p1"><span class="s1">1664272638.443</span><span class="apple-converted-space"> 
</span><span class="s1">10107 10.1.1.70 TCP_MISS/200 275 POST http://192.168.0.2:3001/InternalCommunicationServices/message/email - HIER_DIRECT/192.168.0.2 application/json</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">My suspicion is still that my refresh_pattern is wrong:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">refresh_pattern -i http:\/\/129.168.0.2:3001\/.* 10080 100% 43200 override-lastmod<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Default Sans Serif"">Kind regards,<br>
<br>
Andy Armstrong </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"MS Mincho"">安迪</span><span style="font-family:"Default Sans Serif"">
</span><span style="font-family:"MS Mincho"">阿姆斯特朗</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Default Sans Serif"">Principal Specialist for Z Technologies</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Default Sans Serif"">EMEA Squad Leader for Hybrid Cloud<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Default Sans Serif"">Worldwide Community Leader for Hybrid Cloud<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Default Sans Serif"">Member of the CTO Office Server & Storage EMEA<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Default Sans Serif"">Distinguished Technical Specialist – The Open Group</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Default Sans Serif"">IBM Master Inventor<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
</span><span style="font-family:"Default Sans Serif"">Mobile: +447500103874</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">squid-users <squid-users-bounces@lists.squid-cache.org> on behalf of Alex Rousskov <rousskov@measurement-factory.com><br>
<b>Date: </b>Monday, 26 September 2022 at 21:07<br>
<b>To: </b>squid-users@lists.squid-cache.org <squid-users@lists.squid-cache.org><br>
<b>Subject: </b>[EXTERNAL] Re: [squid-users] TCP_MISS only<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">On 9/26/22 15:27, Andy Armstrong wrote:<br>
<br>
> My aim – is that for any HTTP response from 192.168.0.2:3001 is<br>
> cached and served from the cache.<br>
<br>
> 1664219486.83610098 10.1.1.70 TCP_MISS/201 492 POST <br>
> </span><a href="http://192.168.0.2:3001/InternalCommunicationServices/message/email"><span style="font-size:11.0pt">http://192.168.0.2:3001/InternalCommunicationServices/message/email</span></a><span style="font-size:11.0pt">  
 - <br>
> HIER_DIRECT/192.168.0.2 application/json<br>
<br>
Squid does not cache responses with HTTP status code 201 (Created). Per <br>
HTTP protocol, such responses are not cachable "by default" and Squid is <br>
not smart enough to check whether a particular 201 response has headers <br>
that would allow Squid to overwrite that default. The specific response <br>
in question probably does not have those headers, but I am mentioning <br>
them here for completeness sake.<br>
<br>
Furthermore, a "Created" response to a POST request probably does not <br>
contain anything you would want to cache -- things will probably break <br>
if that "create something" POST request is satisfied from the cache the <br>
next time around. You may need to study the HTTP server in question and <br>
adjust your goals from "cache any 192.168.0.2:3001 response" to <br>
something more nuanced, based on what that server does.<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
<br>
<br>
<br>
<br>
> My config is as follows:<br>
> <br>
> http_port 3128<br>
> <br>
> acl localnet src 10.0.0.0/8     # RFC1918 possible internal network<br>
> <br>
> acl localnet src 172.16.0.0/12  # RFC1918 possible internal network<br>
> <br>
> acl localnet src 192.168.0.0/16 # RFC1918 possible internal network<br>
> <br>
> acl localnet src fc00::/7       # RFC 4193 local private network range<br>
> <br>
> acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) <br>
> machines<br>
> <br>
> acl SSL_ports port 443<br>
> <br>
> acl Safe_ports port 80          # http<br>
> <br>
> acl Safe_ports port 21          # ftp<br>
> <br>
> acl Safe_ports port 443         # https<br>
> <br>
> acl Safe_ports port 70          # gopher<br>
> <br>
> acl Safe_ports port 210         # wais<br>
> <br>
> acl Safe_ports port 280         # http-mgmt<br>
> <br>
> acl Safe_ports port 488         # gss-http<br>
> <br>
> acl Safe_ports port 591         # filemaker<br>
> <br>
> acl Safe_ports port 777         # multiling http<br>
> <br>
> acl Safe_ports port 1025-65535  # unregistered ports<br>
> <br>
> acl CONNECT method CONNECT<br>
> <br>
> http_access deny !Safe_ports<br>
> <br>
> http_access deny CONNECT !SSL_ports<br>
> <br>
> http_access allow localhost manager<br>
> <br>
> http_access deny manager<br>
> <br>
> http_access allow localnet<br>
> <br>
> http_access allow localhost<br>
> <br>
> http_access deny all<br>
> <br>
> coredump_dir /squid/var/cache/squid<br>
> <br>
> cache_dir ufs /var/spool/squid 1024 16 256<br>
> <br>
> refresh_pattern -i </span><a href="http://192.168.0.2:3001%5C/.*"><span style="font-size:11.0pt">http://192.168.0.2:3001%5C/.*</span></a><span style="font-size:11.0pt">  
 10080 100% 43200  <br>
> override-lastmod<br>
> <br>
> refresh_pattern ^ftp:                      1440      20%        10080<br>
> <br>
> refresh_pattern ^gopher:             1440      0%          1440<br>
> <br>
> refresh_pattern -i (/cgi-bin/|\?) 0             0%          0<br>
> <br>
> refresh_pattern .                              0              20%        <br>
> 4320<br>
> <br>
> The problem I am finding is that each time my client makes a call via <br>
> the proxy, I see this in the logs:<br>
> <br>
> 1664219486.83610098 10.1.1.70 TCP_MISS/201 492 POST <br>
> </span><a href="http://192.168.0.2:3001/InternalCommunicationServices/message/email"><span style="font-size:11.0pt">http://192.168.0.2:3001/InternalCommunicationServices/message/email</span></a><span style="font-size:11.0pt">  
 - <br>
> HIER_DIRECT/192.168.0.2 application/json<br>
> <br>
> I see the ‘TCP_MISS’,  the client receives the response from the remote <br>
> server, but on subsequent calls, it continues to trigger TCP_MISS and I <br>
> never manage to cache the response.<br>
> <br>
> Please help me understand what I am missing from the configuration for <br>
> my intended use case.<br>
> <br>
> Kind regards,<br>
> <br>
> Andy Armstrong<br>
> <br>
> </span><span style="font-size:11.0pt;font-family:"MS Gothic"">安迪阿姆斯特朗</span><span style="font-size:11.0pt"><br>
> <br>
> Principal Specialist for Z Technologies<br>
> <br>
> EMEA Squad Leader for Hybrid Cloud<br>
> <br>
> Worldwide Community Leader for Hybrid Cloud<br>
> <br>
> Member of the CTO Office Server & Storage EMEA<br>
> <br>
> Distinguished Technical Specialist – The Open Group<br>
> <br>
> IBM Master Inventor<br>
> <br>
> <br>
> Mobile: +447500103874<br>
> <br>
> Unless otherwise stated above:<br>
> <br>
> IBM United Kingdom Limited<br>
> Registered in England and Wales with number 741598<br>
> Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU<br>
> <br>
> _______________________________________________<br>
> squid-users mailing list<br>
> squid-users@lists.squid-cache.org<br>
> </span><a href="http://lists.squid-cache.org/listinfo/squid-users"><span style="font-size:11.0pt">http://lists.squid-cache.org/listinfo/squid-users</span></a><span style="font-size:11.0pt"> 
<br>
<br>
_______________________________________________<br>
squid-users mailing list<br>
squid-users@lists.squid-cache.org<br>
</span><a href="http://lists.squid-cache.org/listinfo/squid-users"><span style="font-size:11.0pt">http://lists.squid-cache.org/listinfo/squid-users</span></a><span style="font-size:11.0pt"> 
<o:p></o:p></span></p>
</div>
</div>

<DIV>
Unless otherwise stated above:<BR>
<BR>
IBM United Kingdom Limited<BR>
Registered in England and Wales with number 741598<BR>
Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU<BR>
</DIV></body>
</html>