<div dir="ltr"><div><span style="font-size:13px">Dear Amos,</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">Thanks a lot for your explanation and suggestion. I added the "store-stale" to the refresh_pattern rule as:</span></div><div><span style="font-size:13px">refresh_pattern -i \.(ts|m3u8)$ 120 90% 1000 override-expire </span><span style="font-size:13px">override-lastmod ignore-no-cache ignore-no-store store-stale</span><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">However, I have checked the access.log, I am still getting TCP_Miss. </span></div><div><span style="color:rgb(38,50,56);font-size:13px">1496754869.963 13 192.168.0.100 TCP_MISS/200 16636 GET </span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2Fqthttp.apple.com.edgesuite.net%2F1010qwoeiuryfg%2F0150_vod.m3u8&sa=D&sntz=1&usg=AFQjCNHpiHy55EMeBIaMGhgEKRHanTrXxg" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8</a><span style="color:rgb(38,50,56);font-size:13px"> - HIER_DIRECT/</span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2F95.101.182.201&sa=D&sntz=1&usg=AFQjCNE9ZWXH7sOJgbqIA--MJwxobSp76Q" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">95.101.182.201</a><span style="color:rgb(38,50,56);font-size:13px"> application/x-mpegURL</span><br style="color:rgb(38,50,56);font-size:13px"><span style="color:rgb(38,50,56);font-size:13px">1496754870.605 4 </span><span style="color:rgb(38,50,56);font-size:13px">192.168.0.100</span><span style="color:rgb(38,50,56);font-size:13px"> TCP_MISS/200 16636 GET </span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2Fqthttp.apple.com.edgesuite.net%2F1010qwoeiuryfg%2F0150_vod.m3u8&sa=D&sntz=1&usg=AFQjCNHpiHy55EMeBIaMGhgEKRHanTrXxg" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8</a><span style="color:rgb(38,50,56);font-size:13px"> - HIER_DIRECT/</span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2F95.101.182.201&sa=D&sntz=1&usg=AFQjCNE9ZWXH7sOJgbqIA--MJwxobSp76Q" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">95.101.182.201</a><span style="color:rgb(38,50,56);font-size:13px"> application/x-mpegURL</span><br style="color:rgb(38,50,56);font-size:13px"><span style="color:rgb(38,50,56);font-size:13px">1496754871.194 15 </span><span style="color:rgb(38,50,56);font-size:13px">192.168.0.100</span><span style="color:rgb(38,50,56);font-size:13px"> TCP_MISS/200 16636 GET </span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2Fqthttp.apple.com.edgesuite.net%2F1010qwoeiuryfg%2F0150_vod.m3u8&sa=D&sntz=1&usg=AFQjCNHpiHy55EMeBIaMGhgEKRHanTrXxg" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8</a><span style="color:rgb(38,50,56);font-size:13px"> - HIER_DIRECT/</span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2F95.101.182.201&sa=D&sntz=1&usg=AFQjCNE9ZWXH7sOJgbqIA--MJwxobSp76Q" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">95.101.182.201</a><span style="color:rgb(38,50,56);font-size:13px"> application/x-mpegURL</span><br style="color:rgb(38,50,56);font-size:13px"><span style="color:rgb(38,50,56);font-size:13px">1496754871.715 4 </span><span style="color:rgb(38,50,56);font-size:13px">192.168.0.100</span><span style="color:rgb(38,50,56);font-size:13px"> TCP_MISS/200 16636 GET </span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2Fqthttp.apple.com.edgesuite.net%2F1010qwoeiuryfg%2F0150_vod.m3u8&sa=D&sntz=1&usg=AFQjCNHpiHy55EMeBIaMGhgEKRHanTrXxg" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8</a><span style="color:rgb(38,50,56);font-size:13px"> - HIER_DIRECT/</span><a rel="nofollow noreferrer" target="_blank" href="http://www.google.com/url?q=http%3A%2F%2F95.101.182.201&sa=D&sntz=1&usg=AFQjCNE9ZWXH7sOJgbqIA--MJwxobSp76Q" class="gmail-Xx" tabindex="-1" dir="ltr" style="unicode-bidi:-webkit-isolate;color:rgb(38,50,56);font-size:13px">95.101.182.201</a><span style="color:rgb(38,50,56);font-size:13px"> application/x-mpegURL</span><span style="font-size:13px"><br></span></div><div><span style="color:rgb(38,50,56);font-size:13px"><br></span></div><div><font color="#263238">If I understand well, TCP_MISS/200 shows the content is not cached by Squid. Could you please help me to see if anything I did wrong to make .m3u8 not cached by Squid?</font></div><div><br></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">Date: Tue, 6 Jun 2017 14:08:11 +1200</span><br style="font-size:13px"><span style="font-size:13px">From: Amos Jeffries <</span><a href="mailto:squid3@treenet.co.nz" style="font-size:13px">squid3@treenet.co.nz</a><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">To: </span><a href="mailto:squid-users@lists.squid-cache.org" style="font-size:13px">squid-users@lists.squid-cache.<wbr>org</a><br style="font-size:13px"><span style="font-size:13px">Subject: Re: [squid-users] Squid issue of caching the m3u8 file</span><br style="font-size:13px"><span style="font-size:13px">Message-ID: <</span><a href="mailto:5af5e6e9-4880-f58e-106b-9f11dd0a4a7b@treenet.co.nz" style="font-size:13px">5af5e6e9-4880-f58e-106b-<wbr>9f11dd0a4a7b@treenet.co.nz</a><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">Content-Type: text/plain; charset=utf-8; format=flowed</span><br style="font-size:13px"><br style="font-size:13px"><span style="font-size:13px">On 05/06/17 23:54, LIU Yaning wrote:</span><br style="font-size:13px"><span style="font-size:13px">> Dear All,</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> I would like to cache the .m3u8 file to be able to provide offline</span><br style="font-size:13px"><span style="font-size:13px">> caching service by Squid. The played HLS video streaming is the link</span><br style="font-size:13px"><span style="font-size:13px">> as below:</span><br style="font-size:13px"><span style="font-size:13px">> </span><a href="http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8" rel="noreferrer" target="_blank" style="font-size:13px">http://qthttp.apple.com.<wbr>edgesuite.net/1010qwoeiuryfg/<wbr>0150_vod.m3u8</a><br style="font-size:13px"><span style="font-size:13px">> <</span><a href="http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8" rel="noreferrer" target="_blank" style="font-size:13px">http://qthttp.apple.com.<wbr>edgesuite.net/1010qwoeiuryfg/<wbr>0150_vod.m3u8</a><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> However, the .m3u8 file is not be cached probably because it is</span><br style="font-size:13px"><span style="font-size:13px">> mentioned as a no-cache, no-store, max-age=0 in the "Cache-Control" in</span><br style="font-size:13px"><span style="font-size:13px">> the HTTP header.</span><br style="font-size:13px"><span style="font-size:13px">Nope. Only the CC:no-store is preventing caching. The other headers</span><br style="font-size:13px"><span style="font-size:13px">simply put boundaries on what is to be done with the content in the</span><br style="font-size:13px"><span style="font-size:13px">cache. In particular the "no-cache", max-age=0 and Expires values mean</span><br style="font-size:13px"><span style="font-size:13px">it has to be revalidated (REFRESH in your access.log) before any future</span><br style="font-size:13px"><span style="font-size:13px">uses - probably because of that Set-Cookie needing to be changed for</span><br style="font-size:13px"><span style="font-size:13px">different end-users.</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> HTTP/1.1 200 OK</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Server: Apache</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> ETag: "</span><wbr style="font-size:13px"><span style="font-size:13px">1d7168b4f49e75f76f3182f24bf075</span><wbr style="font-size:13px"><span style="font-size:13px">f6:1299516751"</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Last-Modified: Mon, 07 Mar 2011 16:52:31 GMT</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Expires: Fri, 02 Jun 2017 14:26:52 GMT</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Cache-Control: max-age=0, no-cache, no-store</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Pragma: no-cache</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Date: Fri, 02 Jun 2017 14:26:52 GMT</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Content-Length: 16046</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Set-Cookie: AKID=</span><wbr style="font-size:13px"><span style="font-size:13px">77F9F1316ECCE780566608C5E514DE</span><wbr style="font-size:13px"><span style="font-size:13px">0A;expires=Fri, 26 Aug</span><br style="font-size:13px"><span style="font-size:13px">> 2016 00:01:00 GMT; path=/; domain=</span><a href="http://qthttp.apple.com.edgesuite.net/" rel="noreferrer" target="_blank" style="font-size:13px">qthttp.apple.com.<wbr>edgesuite.net</a><br style="font-size:13px"><span style="font-size:13px">> <</span><a href="http://qthttp.apple.com.edgesuite.net/" rel="noreferrer" target="_blank" style="font-size:13px">http://qthttp.apple.com.<wbr>edgesuite.net/</a><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Content-Type: application/x-mpegURL</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Access-Control-Allow-Origin: *</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> I added a new rule for .m3u8 file in squid.conf, however, it is still</span><br style="font-size:13px"><span style="font-size:13px">> not working.</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> refresh_pattern -i \.(ts|m3u8)$ 120 90% 1000 override-expire</span><br style="font-size:13px"><span style="font-size:13px">> override-lastmod ignore-no-cache ignore-no-store</span><br style="font-size:13px"><span style="font-size:13px">></span><br style="font-size:13px"><span style="font-size:13px">> Does anyone know how to allow Squid caching the .m3u8 file? Thanks a</span><br style="font-size:13px"><span style="font-size:13px">> lot in advance.</span><br style="font-size:13px"><span style="font-size:13px">What makes you think it is not caching? The ignore-no-store alone should</span><br style="font-size:13px"><span style="font-size:13px">be sufficient to allow current Squid versions to cache that object. You</span><br style="font-size:13px"><span style="font-size:13px">could perhapse add "store-stale" option on that config line. Which</span><br style="font-size:13px"><span style="font-size:13px">should make Squid cache object containing an Expires header with current</span><br style="font-size:13px"><span style="font-size:13px">or past values. refresh_pattern settings do not affect that cacheable vs</span><br style="font-size:13px"><span style="font-size:13px">non-cacheable decision. The no-cache header tells Squid the object needs</span><br style="font-size:13px"><span style="font-size:13px">revalidating before every use. However, be aware the tool at </span><a href="http://redbot.org/" rel="noreferrer" target="_blank" style="font-size:13px">redbot.org</a><br style="font-size:13px"><span style="font-size:13px">tells me that this URL is badly broken in how it is using the ETag and</span><br style="font-size:13px"><span style="font-size:13px">Vary headers - in a way which can break the revalidation when these</span><br style="font-size:13px"><span style="font-size:13px">things are cached. Some of your clients may see very broken behaviour</span><br style="font-size:13px"><span style="font-size:13px">accessing this object unless you follow the no-store requirement or the</span><br style="font-size:13px"><span style="font-size:13px">server stops its broken ETag behaviour. PS. if you are using a Squid</span><br style="font-size:13px"><span style="font-size:13px">version much older than 3.5.24 I recommend an upgrade. With an urgency</span><br style="font-size:13px"><span style="font-size:13px">increasing the older your Squid is. Amos</span><br style="font-size:13px"></div><div><br></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Best Regards,<br>--<br>Yaning.<br></div>
</div>