<html xmlns:v="urn:schemas-microsoft-com:vml" 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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EstiloCorreo17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ES" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="CA">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">I’m trying build a squid server that can cache youtube request for a school.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">I’m using squid 3.4.7 compiled from source on Ubuntu server 14.04
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">I have a lot of request that are cached, but not served from cache and generate a TCP_MISS/200<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">I’m trying to figure why this requests are not served from cache.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Please find attached squid.conf and cache.log sample with debug enabled.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">I hope someone can help me.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">Thanks <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">Josep<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">*************************************************** access.log *******************************************************************<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">1412953551.775 167 192.168.1.112 TCP_MISS/200 4344 GET http://i1.ytimg.com/vi/9_iANxI-Mrc/default.jpg - ORIGINAL_DST/74.125.230.3 image/jpeg<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">****************************** cache.log ******************************************************************************************<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">----------<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.772| ctx: enter level 0: 'http://ytimg.com.squid.internal/vi/9_iANxI-Mrc/default.jpg'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| http.cc(705) processReplyHeader: processReplyHeader: key '9F1BB8D27BED16A8B74F8995105B2941'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| http.cc(749) processReplyHeader: HTTP Server local=192.168.111.10:59210 remote=74.125.230.3:80 FD 65 flags=1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| http.cc(750) processReplyHeader: HTTP Server REPLY:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">---------<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">HTTP/1.1 200 OK<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Content-Type: image/jpeg<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Last-Modified: Thu, 01 Jan 1970 00:23:21 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Date: Fri, 10 Oct 2014 10:45:51 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Expires: Fri, 10 Oct 2014 16:45:51 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">X-Content-Type-Options: nosniff<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Server: sffe<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Content-Length: 3861<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">X-XSS-Protection: 1; mode=block<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Age: 15619<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Cache-Control: public, max-age=21600<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Alternate-Protocol: 80:quic,p=0.01<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">����<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">----------<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| ctx: exit level 0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| ctx: enter level 0: 'http://ytimg.com.squid.internal/vi/9_iANxI-Mrc/default.jpg'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| http.cc(919) haveParsedReplyHeaders: HTTP CODE: 200<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(247) refreshCheck: refreshCheck: 'http://ytimg.com.squid.internal/vi/9_iANxI-Mrc/default.jpg'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(262) refreshCheck: refreshCheck: Matched '^http:\/\/ytimg\.com\.squid\.internal.* 604800 80%% 4794000'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(264) refreshCheck: age: 15679<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(266) refreshCheck: check_time: Fri, 10 Oct 2014 15:06:51 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(268) refreshCheck: entry->timestamp: Fri, 10 Oct 2014 10:45:32 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(171) refreshStaleness: FRESH: expires 1412959532 >= check_time 1412953611<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(288) refreshCheck: Staleness = -1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(373) refreshCheck: refreshCheck: object isn't stale..<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| refresh.cc(375) refreshCheck: refreshCheck: returning FRESH_EXPIRES<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.773| http.cc(482) cacheableReply: YES because HTTP status 200<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.774| ctx: exit level 0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.774| client_side.cc(1459) sendStartOfMessage: HTTP Client local=74.125.230.3:80 remote=192.168.1.112:50084 FD 62 flags=33<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">2014/10/10 17:05:51.774| client_side.cc(1460) sendStartOfMessage: HTTP Client REPLY:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">---------<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">HTTP/1.1 200 OK<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Content-Type: image/jpeg<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Last-Modified: Thu, 01 Jan 1970 00:23:21 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Date: Fri, 10 Oct 2014 10:45:51 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Expires: Fri, 10 Oct 2014 16:45:51 GMT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">X-Content-Type-Options: nosniff<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Server: sffe<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Content-Length: 3861<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">X-XSS-Protection: 1; mode=block<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Age: 15619<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Cache-Control: public, max-age=21600<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Alternate-Protocol: 80:quic,p=0.01<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">X-Cache: MISS from squid-v2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">X-Cache-Lookup: MISS from squid-v2:3128<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Via: 1.1 squid-v2 (squid/3.4.7)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">Connection: keep-alive<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">----------<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">********************************************************************** squid.conf *******************************************************<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"># debug helper<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">#debug_options 84,3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">#debug Refresh Calculation<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">#debug_options 22,3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"># HTTP<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">#debug_options 11,3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">debug_options 11,3 22,3 84,3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl customernet src 172.16.212.154/32<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl customernet src 192.168.1.0/24<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl SSL_ports port 443<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl SSL_ports port 873 # rsync<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 80 # http<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 21 # ftp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 443 # https<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 70 # gopher<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 210 # wais<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 1025-65535 # unregistered ports<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 280 # http-mgmt<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 488 # gss-http<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 591 # filemaker<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl Safe_ports port 777 # multiling http<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl CONNECT method CONNECT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_access deny !Safe_ports<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_access deny CONNECT !SSL_ports<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_access allow localhost manager<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_access deny manager<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_access allow localhost<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_access allow customernet<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_access deny all<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"># http_access allow all<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">#HTTPS (SSL) trafic interception options<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">always_direct allow SSL_ports<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">ssl_bump server-first SSL_ports<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">#sslproxy_cert_error deny all<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">#sslproxy_flags DONT_VERIFY_PEER<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">sslcrtd_program /usr/lib/squid3/ssl_crtd -s /var/spool/squid3_ssldb -M 4MB<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">sslcrtd_children 8 startup=1 idle=1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">acl rewritedoms dstdomain .c.youtube.com .googlevideo.com .ytimg.com<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">store_id_program /usr/lib/squid3/storeid_file_rewrite /etc/squid3/storeid_rewrite<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">store_id_children 40 startup=10 idle=5 concurrency=0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">store_id_access allow rewritedoms<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">store_id_access deny all<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_port 3128<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">http_port 8080 intercept<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">https_port 8081 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid3/ssl_cert/squidcert.pem<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">forward_max_tries 25<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">cache_mem 2 GB<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">maximum_object_size_in_memory 25 MB<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">maximum_object_size 1 GB<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">visible_hostname squid-v2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">dns_v4_first on<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">coredump_dir /var/spool/squid3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">cache_replacement_policy heap LFUDA<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">cache_dir aufs /var/spool/squid3 14000 16 256<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA">refresh_pattern ^http:\/\/video-srv\.(googlevideo|youtube)\.com\.squid\.internal.* 10080 80% 79900 override-lastmod override-expire ignore-reload ignore-must-revalidate ignore-private<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">refresh_pattern ^http:\/\/ytimg\.com\.squid\.internal.* 10080 80% 79900 override-lastmod override-expire ignore-reload ignore-must-revalidate ignore-private<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">refresh_pattern ^ftp: 1440 20% 10080<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">refresh_pattern ^gopher: 1440 0% 1440<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">refresh_pattern -i (/cgi-bin/|\?) 0 0% 0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">refresh_pattern . 0 20% 4320<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"># FortiGate interface of wccp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">wccp2_router 192.168.111.1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"># wccp version 2 configuration<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">wccp2_service standard 90<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"># tunneling method GRE for forward traffic<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">wccp2_forwarding_method gre<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"># tunneling method GRE for return traffic<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">wccp2_return_method gre<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"># which interface to use for WCCP (0.0.0.0 determines the interface from routing)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA">wccp2_address 0.0.0.0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="CA"><o:p> </o:p></span></p>
</div>
</body>
</html>