<div dir="auto">I've not got time to read your whole email, but you are asking about regular expressions.<div dir="auto"><br></div><div dir="auto">^http:\/\/[^\.]+\.dl\.sourceforge\.net\/(.*) <a href="http://dl.sourceforge.net.squid.internal/$1">http://dl.sourceforge.net.squid.internal/$1</a></div><div dir="auto"><br></div><div dir="auto">What this means is to match the first URL and "capture" the bit at the end, the bit in brackets. This then gets rewritten to the second URL with the captured bit added on to the end, that is $1. If you captured two things in brackets the first would be $1, the second $2.</div><div dir="auto"><br></div><div dir="auto">Do some reading on regex and regular expressions. The basics are relatively easy to understand, beyond that, it can get very complicated very quickly. </div><div dir="auto"><br></div><div dir="auto">Robin</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, 31 Dec 2024, 23:05 Jonathan Lee, <<a href="mailto:jonathanlee571@gmail.com">jonathanlee571@gmail.com</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"><div style=""><b>Hello Fellow Squid Users,</b><div><b><br></b></div><div><b>Can you please help? I have been researching this for a long time and cannot find any information on this "what is the $ mean” within StoreID?</b></div><div><b><br></b></div><div><b>Below is my failed attempt to make StoreID work correctly. Sorry it's a mess. I have since disabled my customized StoreID patterns because it caused issues. My question is with regard to the $number part of the program. I disabled all the facebook and all my tests because my photos where showing up wrong and it would duplicate itself over everything, I would have to clear the cache and change items and try again below is my failed attempt to get it to work correctly. </b></div><div><b><br></b></div><div><b>It did work sometimes however I would get issues the longer it went on for. I decided to stop the trial and testing of it because it was driving me crazy. It is a great puzzle to solve. Does anyone have any tips? I have some Squid text books like the Squid the definitive guide, and The Squid Proxy Server 3.1 guide still nothing really explains StoreID outside of the Squid website. Yes the website comes with a great database that does work, I tested some database items with Ubuntu updates inside of VMs and it worked and reserved them to other machines asking for the same update. So in my quest I thought can I also do this with Facebook… (I do not recommend you try it) or something else, Youtube. </b></div><div><b><br></b></div><div><b>This is the Text file I have been testing and it was a failed test outside of Ubuntu updates however I do not use that OS anymore so it is removed I think I had the $ wrong I have no info on what it does some are 1 some are 5 some are doubles $ and another of them:</b></div><div><br></div><div><div><i><font color="#ff9300"><b>^https?:\/\/(fbcdn|scontent).*(akamaihd|fbcdn)\.net\/.*\/v\/.*\/(.*\.mp4)<span style="white-space:pre-wrap"> </span><a href="http://facebook.squid.internal/$3" target="_blank" rel="noreferrer">http://facebook.squid.internal/$3</a></b></font></i></div><div><i><font color="#ff9300"><b>^https?:\/\/fbcdn\-(static|profile)\-a\.akamaihd\.net\/static\-ak\/rsrc\.php\/((?!.*\.(?:js|css|swf)).*)<span style="white-space:pre-wrap"> </span><a href="http://facebook.squid.internal/static/$2" target="_blank" rel="noreferrer">http://facebook.squid.internal/static/$2</a></b></font></i></div><div><i><font color="#ff9300"><b>^https?:\/\/(fbcdn|scontent).*(akamaihd|fbcdn)\.net\/(h|s)(profile|photos).*\/(.*\.(png|gif|jpg))(\?.+)? <span style="white-space:pre-wrap"> </span><a href="http://facebook.squid.internal/$5" target="_blank" rel="noreferrer">http://facebook.squid.internal/$5</a></b></font></i></div><div><i><font color="#ff9300"><b>^https?:\/\/fbstatic\-a\.akamaihd\.net\/rsrc\.php\/((?!.*\.(?:js|css|swf)).*) <span style="white-space:pre-wrap"> </span><a href="http://facebook.squid.internal/static/$1" target="_blank" rel="noreferrer">http://facebook.squid.internal/static/$1</a></b></font></i></div><div><i><font color="#ff9300"><b>^http:\/\/.*[steampowered|steamcontent]\.com\/([^?]*)<span style="white-space:pre-wrap"> </span><a href="http://steamupdates.squid.internal/$1" target="_blank" rel="noreferrer">http://steamupdates.squid.internal/$1</a></b></font></i></div><div><i><font color="#ff9300"><b>^https?\:\/\/download\.oracle\.com\/((otn\-pub|otn)\/[\d\w]+\/[\d\w]+\/[\w\d\-]+\/[\w\d\-]+\.(exe|dmg|rpm|msi|tar\.(gz|Z)))\?<span style="white-space:pre-wrap"> </span><a href="http://java.oracle.otn.ngtech.squid.internal/$1" target="_blank" rel="noreferrer">http://java.oracle.otn.ngtech.squid.internal/$1</a></b></font></i></div><div><i><font color="#ff9300"><b>^https?\:\/\/([\d\w\-]+)\.oracle\.com\/(([\d\w]+)\/[\d\w]+\/[\d\w]+\/([\d\w\-]+)\/([\d\w]+\/)?[\d\w\-\.\_]+\.(dmg|msi|exe|tar\.gz|tar\.Z))\?<span style="white-space:pre-wrap"> </span><a href="http://java.oracle.download.ngtech.squid.internal/$2" target="_blank" rel="noreferrer">http://java.oracle.download.ngtech.squid.internal/$2</a></b></font></i></div><div><i><font color="#ff9300"><b>^http:\/\/[^\.]+\.phobos\.apple\.com\/(.*)<span style="white-space:pre-wrap"> </span><a href="http://appupdates.apple.squid.internal/$1" target="_blank" rel="noreferrer">http://appupdates.apple.squid.internal/$1</a></b></font></i></div><div><i><font color="#ff9300"><b>^http:\/\/[^\.]+\.c\.android\.clients\.google\.com\/(.*)<span style="white-space:pre-wrap"> </span><a href="http://androidupdates.google.squid.internal/$1" target="_blank" rel="noreferrer">http://androidupdates.google.squid.internal/$1</a></b></font></i></div></div><div><br></div><div><b>My question here is:</b></div><div><b>What does this $3 mean within the the store id program?</b></div><div><b><br></b></div><div><b>This is the config and refresh patterns that I was learning with for Squid StoreID. Much of it is “#”ed out but this is what I was using:</b></div><div><br></div><div><div><i><font color="#0433ff">#store_id_program /usr/local/libexec/squid/storeid_file_rewrite /var/squid/storeid/storeid_rewrite.txt</font></i></div><div><i><font color="#0433ff">#store_id_children 10 startup=5 idle=1 concurrency=0</font></i></div><div><i><font color="#0433ff">#always_direct allow all</font></i></div><div><i><font color="#0433ff">#store_id_access deny connect</font></i></div><div><i><font color="#0433ff">#store_id_access deny !getmethod</font></i></div><div><i><font color="#0433ff">#store_id_access allow rewritedoms</font></i></div><div><i><font color="#0433ff">#store_id_access deny all</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">refresh_all_ims on</font></i></div><div><i><font color="#0433ff">reload_into_ims on</font></i></div><div><i><font color="#0433ff">max_stale 20 years</font></i></div><div><i><font color="#0433ff">minimum_expiry_time 0</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ^http.*squid\.internal.* 43200 100% 79900 override-expire override-lastmod ignore-reload ignore-no-store ignore-must-revalidate ignore-private ignore-auth</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#FACEBOOK</font></i></div><div><i><font color="#0433ff">#refresh_pattern ^https.*.<a href="http://facebook.com/*" target="_blank" rel="noreferrer">facebook.com/*</a> 10080 80% 43200</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#FACEBOOK IMAGES </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i pixel.facebook.com..(jpg|png|gif|ico|css|js|jpg?) 10080 80% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i .akamaihd.net..(jpg|png|gif|ico|css|js|jpg?) 10080 80% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i facebook.com.(jpg|png|gif|jpg?) 10080 80% 43200 store-stale</font></i></div><div><i><font color="#0433ff">#refresh_pattern static.(xx|ak).fbcdn.net.(jpg|gif|png|jpg?) 10080 80% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern ^https.*profile.ak.fbcdn.net.*(jpg|gif|png|jpg?) 10080 80% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern ^https.*fbcdn.net.*(jpg|gif|png|jpg?) 10080 80% 43200</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#FACEBOOK VIDEO</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i .video.ak.fbcdn.net.*.(mp4|flv|mp3|amf) 10080 80% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern (audio|video)/(webm|mp4) 10080 80% 43200</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#APPLE STUFF</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i <a href="http://apple.com/..(cab%7Cexe%7Cmsi%7Cmsu%7Cmsf%7Casf%7Cwmv%7Cwma%7Cdat%7Czip%7Cdist)$" target="_blank" rel="noreferrer">apple.com/..(cab|exe|msi|msu|msf|asf|wmv|wma|dat|zip|dist)$</a> 0 80% 43200 refresh-ims</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#apple update</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i (download|adcdownload).<a href="http://apple.com/.*%5C.(pkg%7Cdmg)" target="_blank" rel="noreferrer">apple.com/.*\.(pkg|dmg)</a> 4320 100% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i appldnld\.apple\.com 129600 100% 129600</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i phobos\.apple\.com 129600 100% 129600</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i iosapps\.itunes\.apple\.com 129600 100% 129600</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">refresh_pattern -i <a href="http://windowsupdate.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%7Cp%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip%7Cpsf)" target="_blank" rel="noreferrer">windowsupdate.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf)</a> 43200 80% 129600 reload-into-ims</font></i></div><div><i><font color="#0433ff">refresh_pattern -i <a href="http://microsoft.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%7Cp%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip%7Cpsf)" target="_blank" rel="noreferrer">microsoft.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf)</a> 43200 80% 129600 reload-into-ims</font></i></div><div><i><font color="#0433ff">refresh_pattern -i <a href="http://windows.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%7Cp%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip%7Cpsf)" target="_blank" rel="noreferrer">windows.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf)</a> 43200 80% 129600 reload-into-ims</font></i></div><div><i><font color="#0433ff">refresh_pattern -i <a href="http://microsoft.com.akadns.net/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%7Cp%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip%7Cpsf)" target="_blank" rel="noreferrer">microsoft.com.akadns.net/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf)</a> 43200 80% 129600 reload-into-ims</font></i></div><div><i><font color="#0433ff">refresh_pattern -i <a href="http://deploy.akamaitechnologies.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%7Cp%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip%7Cpsf)" target="_blank" rel="noreferrer">deploy.akamaitechnologies.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf)</a> 43200 80% 129600 reload-into-ims</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff"># Updates: Windows</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i <a href="http://microsoft.com/..(cab%7Cexe%7Cmsi%7Cmsu%7Cmsf%7Casf%7Cwma%7Cdat%7Czip)$" target="_blank" rel="noreferrer">microsoft.com/..(cab|exe|msi|msu|msf|asf|wma|dat|zip)$</a> 4320 80% 43200 refresh-ims</font></i></div><div><i><font color="#0433ff">refresh_pattern -i <a href="http://windowsupdate.com/..(cab%7Cexe%7Cmsi%7Cmsu%7Cmsf%7Casf%7Cwma%7Cwmv)%7Cdat%7Czip)$" target="_blank" rel="noreferrer">windowsupdate.com/..(cab|exe|msi|msu|msf|asf|wma|wmv)|dat|zip)$</a> 4320 80% 43200 refresh-ims</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i <a href="http://windows.com/..(cab%7Cexe%7Cmsi%7Cmsu%7Cmsf%7Casf%7Cwmv%7Cwma%7Cdat%7Czip)$" target="_blank" rel="noreferrer">windows.com/..(cab|exe|msi|msu|msf|asf|wmv|wma|dat|zip)$</a> 4320 80% 43200 refresh-ims</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i <a href="http://microsoft.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip)" target="_blank" rel="noreferrer">microsoft.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip)</a> 4320 80% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i <a href="http://windowsupdate.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip)" target="_blank" rel="noreferrer">windowsupdate.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip)</a> 4320 80% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i <a href="http://windows.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip)" target="_blank" rel="noreferrer">windows.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip)</a> 4320 80% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i .*<a href="http://windowsupdate.com/.*%5C.(cab%7Cexe)" target="_blank" rel="noreferrer">windowsupdate.com/.*\.(cab|exe)</a> 259200 100% 259200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i .*<a href="http://update.microsoft.com/.*%5C.(cab%7Cexe%7Cdll%7Cmsi%7Cpsf)" target="_blank" rel="noreferrer">update.microsoft.com/.*\.(cab|exe|dll|msi|psf)</a> 259200 100% 259200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern <a href="http://windowsupdate.com/.*%5C.(cab%7Cexe%7Cdll%7Cmsi%7Cpsf)" target="_blank" rel="noreferrer">windowsupdate.com/.*\.(cab|exe|dll|msi|psf)</a> 10080 100% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern <a href="http://download.microsoft.com/.*%5C.(cab%7Cexe%7Cdll%7Cmsi%7Cpsf)" target="_blank" rel="noreferrer">download.microsoft.com/.*\.(cab|exe|dll|msi|psf)</a> 10080 100% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern <a href="http://www.microsoft.com/.*%5C.(cab%7Cexe%7Cdll%7Cmsi%7Cpsf)" target="_blank" rel="noreferrer">www.microsoft.com/.*\.(cab|exe|dll|msi|psf)</a> 10080 100% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern <a href="http://au.download.windowsupdate.com/.*%5C.(cab%7Cexe%7Cdll%7Cmsi%7Cpsf)" target="_blank" rel="noreferrer">au.download.windowsupdate.com/.*\.(cab|exe|dll|msi|psf)</a> 4320 100% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern <a href="http://bg.v4.pr.dl.ws.microsoft.com/.*%5C.(cab%7Cexe%7Cdll%7Cmsi%7Cpsf)" target="_blank" rel="noreferrer">bg.v4.pr.dl.ws.microsoft.com/.*\.(cab|exe|dll|msi|psf)</a> 4320 100% 43200</font></i></div><div><i><font color="#0433ff">#windows update NEW UPDATE 0.04</font></i></div><div><i><font color="#0433ff">#refresh_pattern <a href="http://update.microsoft.com/.*%5C.(cab%7Cexe)" target="_blank" rel="noreferrer">update.microsoft.com/.*\.(cab|exe)</a> 43200 100% 129600 </font></i></div><div><i><font color="#0433ff">#refresh_pattern ([^.]+\.)?(download|(windows)?update)\.(microsoft\.)?com/.*\.(cab|exe|msi|msp|psf) 4320 100% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern <a href="http://update.microsoft.com/.*%5C.(cab%7Cexe%7Cdll%7Cmsi%7Cpsf)" target="_blank" rel="noreferrer">update.microsoft.com/.*\.(cab|exe|dll|msi|psf)</a> 10080 100% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i \.<a href="http://update.microsoft.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip)" target="_blank" rel="noreferrer">update.microsoft.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip)</a> 525600 100% 525600 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i \.<a href="http://windowsupdate.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip)" target="_blank" rel="noreferrer">windowsupdate.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip)</a> 525600 100% 525600 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i \.<a href="http://download.microsoft.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip)" target="_blank" rel="noreferrer">download.microsoft.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip)</a> 525600 100% 525600 </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i \.<a href="http://ws.microsoft.com/.*%5C.(cab%7Cexe%7Cms%5Bi%7Cu%7Cf%5D%7C%5Bap%5Dsf%7Cwm%5Bv%7Ca%5D%7Cdat%7Czip)" target="_blank" rel="noreferrer">ws.microsoft.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip)</a> 525600 100% 525600 </font></i></div><div><i><font color="#0433ff"> </font></i></div><div><i><font color="#0433ff">#refresh_pattern ([^.]+\.)?(cs|content[1-9]|hsar|content-origin|client-download).[steampowered|steamcontent].com/.*\.* 43200 100% 43200 </font></i></div><div><i><font color="#0433ff">#refresh_pattern ([^.]+\.)?.<a href="http://akamai.steamstatic.com/.*%5C.*" target="_blank" rel="noreferrer">akamai.steamstatic.com/.*\.*</a> 43200 100% 43200</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ([^.]+\.)?.<a href="http://adobe.com/.*%5C.(zip%7Cexe)" target="_blank" rel="noreferrer">adobe.com/.*\.(zip|exe)</a> 43200 100% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ([^.]+\.)?.<a href="http://java.com/.*%5C.(zip%7Cexe)" target="_blank" rel="noreferrer">java.com/.*\.(zip|exe)</a> 43200 100% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ([^.]+\.)?.<a href="http://sun.com/.*%5C.(zip%7Cexe)" target="_blank" rel="noreferrer">sun.com/.*\.(zip|exe)</a> 43200 100% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ([^.]+\.)?.<a href="http://oracle.com/.*%5C.(zip%7Cexe%7Ctar.gz)" target="_blank" rel="noreferrer">oracle.com/.*\.(zip|exe|tar.gz)</a> 43200 100% 43200</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#refresh_pattern -i appldnld\.apple\.com 43200 100% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ([^.]+\.)?<a href="http://apple.com/.*%5C.(ipa)" target="_blank" rel="noreferrer">apple.com/.*\.(ipa)</a> 43200 100% 43200</font></i></div><div><i><font color="#0433ff"> </font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ([^.]+\.)?.<a href="http://google.com/.*%5C.(exe%7Ccrx)" target="_blank" rel="noreferrer">google.com/.*\.(exe|crx)</a> 10080 80% 43200</font></i></div><div><i><font color="#0433ff">#refresh_pattern -i ([^.]+\.)?<a href="http://g.static.com/.*%5C.(exe%7Ccrx)" target="_blank" rel="noreferrer">g.static.com/.*\.(exe|crx)</a> 10080 80% 43200</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">acl https_login url_regex -i ^https.*(login|Login).*</font></i></div><div><i><font color="#0433ff">cache deny https_login</font></i></div><div><i><font color="#0433ff"><br></font></i></div><div><i><font color="#0433ff">#range_offset_limit 512 MB windowsupdate</font></i></div><div><i><font color="#0433ff">range_offset_limit 0 !windowsupdate</font></i></div><div><i><font color="#0433ff">quick_abort_min -1 KB</font></i></div></div><div><br></div><div><br></div><div><b>Store ID program:</b></div><div><b><br></b></div><div><b>I am using the built in program attached here..</b></div><div><b>/usr/local/libexec/squid/storeid_file_rewrite</b></div><div><div><i><font color="#ff40ff"><b style="font-size:14px">#!/usr/local/bin/perl</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">use strict;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">use warnings;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">use Pod::Usage;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=pod</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 NAME</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> storeid_file_rewrite - File based Store-ID helper for Squid</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 SYNOPSIS</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> storeid_file_rewrite filepath</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 DESCRIPTION</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">This program acts as a store_id helper program, rewriting URLs passed</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">by Squid into storage-ids that can be used to achieve better caching</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">for websites that use different URLs for the same content.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">It takes a text file with two tab separated columns.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Column 1: Regular expression to match against the URL</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Column 2: Rewrite rule to generate a Store-ID</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Eg:</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">^http:\/\/[^\.]+\.dl\.sourceforge\.net\/(.*) <a href="http://dl.sourceforge.net.squid.internal/$1" target="_blank" rel="noreferrer">http://dl.sourceforge.net.squid.internal/$1</a></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Rewrite rules are matched in the same order as they appear in the rules file.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">So for best performance, sort it in order of frequency of occurrence.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">This program will automatically detect the existence of a concurrency channel-ID and adjust appropriately.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">It may be used with any value 0 or above for the store_id_children concurrency= parameter.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 OPTIONS</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">The only command line parameter this helper takes is the regex rules file name.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 AUTHOR</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">This program and documentation was written by I<Alan Mizrahi <<a href="mailto:alan@mizrahi.com.ve" target="_blank" rel="noreferrer">alan@mizrahi.com.ve</a>>></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Based on prior work by I<Eliezer Croitoru <<a href="mailto:eliezer@ngtech.co.il" target="_blank" rel="noreferrer">eliezer@ngtech.co.il</a>>></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 COPYRIGHT</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> * Copyright (C) 1996-2023 The Squid Software Foundation and contributors</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> *</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> * Squid software is distributed under GPLv2+ license and includes</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> * contributions from numerous individuals and organizations.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> * Please see the COPYING and CONTRIBUTORS files for details.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> Copyright (C) 2013 Alan Mizrahi <<a href="mailto:alan@mizrahi.com.ve" target="_blank" rel="noreferrer">alan@mizrahi.com.ve</a>></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> Based on code from Eliezer Croitoru <<a href="mailto:eliezer@ngtech.co.il" target="_blank" rel="noreferrer">eliezer@ngtech.co.il</a>></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> This program is free software; you can redistribute it and/or modify</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> it under the terms of the GNU General Public License as published by</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> the Free Software Foundation; either version 2 of the License, or</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> (at your option) any later version.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> This program is distributed in the hope that it will be useful,</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> but WITHOUT ANY WARRANTY; without even the implied warranty of</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> GNU General Public License for more details.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> You should have received a copy of the GNU General Public License</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> along with this program; if not, write to the Free Software</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> Foundation, Inc., <a href="https://www.google.com/maps/search/59+Temple+Place,+Suite+330,+Boston,+MA++02111-1307,+USA?entry=gmail&source=g">59 Temple Place, Suite 330, Boston, MA </a> <a href="https://www.google.com/maps/search/59+Temple+Place,+Suite+330,+Boston,+MA++02111-1307,+USA?entry=gmail&source=g">02111-1307, USA</a>.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 QUESTIONS</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Questions on the usage of this program can be sent to the I<Squid Users mailing list <<a href="mailto:squid-users@lists.squid-cache.org" target="_blank" rel="noreferrer">squid-users@lists.squid-cache.org</a>>></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 REPORTING BUGS</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Bug reports need to be made in English.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">See <a href="http://wiki.squid-cache.org/SquidFaq/BugReporting" target="_blank" rel="noreferrer">http://wiki.squid-cache.org/SquidFaq/BugReporting</a> for details of what you need to include with your bug report.</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Report bugs or bug fixes using <a href="http://bugs.squid-cache.org/" target="_blank" rel="noreferrer">http://bugs.squid-cache.org/</a></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Report serious security bugs to I<Squid Bugs <<a href="mailto:squid-bugs@lists.squid-cache.org" target="_blank" rel="noreferrer">squid-bugs@lists.squid-cache.org</a>>></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">Report ideas for new improvements to the I<Squid Developers mailing list <<a href="mailto:squid-dev@lists.squid-cache.org" target="_blank" rel="noreferrer">squid-dev@lists.squid-cache.org</a>>></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=head1 SEE ALSO</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">squid (8), GPL (7),</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">The Squid wiki <a href="http://wiki.squid-cache.org/Features/StoreID" target="_blank" rel="noreferrer">http://wiki.squid-cache.org/Features/StoreID</a></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">The Squid Configuration Manual <a href="http://www.squid-cache.org/Doc/config/" target="_blank" rel="noreferrer">http://www.squid-cache.org/Doc/config/</a></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">=cut</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">my @rules; # array of [regex, replacement string]</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">die "Usage: $0 <rewrite-file>\n" unless $#ARGV == 0;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"># read config file</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">open RULES, $ARGV[0] or die "Error opening $ARGV[0]: $!";</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">while (<RULES>) {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> chomp;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> next if /^\s*#?$/;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> if (/^\s*([^\t]+?)\s*\t+\s*([^\t]+?)\s*$/) {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> push(@rules, [qr/$1/, $2]);</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> } else {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> print STDERR "$0: Parse error in $ARGV[0] (line $.)\n";</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> }</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">}</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">close RULES;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">$|=1;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"># read urls from squid and do the replacement</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">URL: while (<STDIN>) {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> chomp;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> last if $_ eq 'quit';</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> my $channel = "";</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> if (s/^(\d+\s+)//o) {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> $channel = $1;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> }</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> foreach my $rule (@rules) {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> if (my @match = /$rule->[0]/) {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> $_ = $rule->[1];</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"><br></b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> for (my $i=1; $i<=scalar(@match); $i++) {</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> s/\$$i/$match[$i-1]/g;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> }</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> print $channel, "OK store-id=$_\n";</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> next URL;</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> }</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> }</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px"> print $channel, "ERR\n";</b></font></i></div><div><i><font color="#ff40ff"><b style="font-size:14px">}</b></font></i></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>_______________________________________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org" target="_blank" rel="noreferrer">squid-users@lists.squid-cache.org</a><br>
<a href="https://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer noreferrer" target="_blank">https://lists.squid-cache.org/listinfo/squid-users</a><br>
</blockquote></div>