[squid-users] how works store-id ?

Amos Jeffries squid3 at treenet.co.nz
Mon Mar 7 18:41:41 UTC 2016


On 8/03/2016 12:16 a.m., Tony Peña wrote:
> hi . .i trying to use store id.
> i copy and paste some lines from many tutorials using this script and squid
> is working with it..

What tutorials?


> i check if the object will be store with store-id result as OK, and for
> windows update works and did it swapout, but for other objects example .msi
> the script do store-id OK but don't swapout.. it's doing release..
> 
> echo "
> http://armmf.adobe.com/arm-manifests/win/ServicesUpdater/DC/RdrManifest.msi"
> | /usr/lib/squid3/storeid_file_rewrite /etc/squid3/url_patterns
> OK store-id=http://adobe.squid.internal/msi
> 
> on the logs
> 
> 1457348646.201 RELEASE -1 FFFFFFFF AD0EA341D9655150F4BD0DB566F55E4A  502
> 1457348646         0        -1 text/html 25696/25696 GET
> http://armmf.adobe.com/arm-manifests/win/ServicesUpdater/DC/RdrManifest.msi
> 

Store-ID is not a magic pill to cache things. It is a way to specify
semi-manual assignment of Squid cache slots to particular *groups* of
URLs for the purpose of de-duplicating *identical* objects that are
served up through multiple CDN servers or domains.


> it's possible maybe the regex is wrong..
> 
> this is the pattern to check when script read
> .*\.(exe|msi|msp|msu|dmg|bin|xpi|iso|psf|cab|dsft|swz|pkg|z|idx|gz|upd|aup|cer)$
>        http://aron.squid.internal/$1
> 
> any idea? or what i'm missing?


If you cannot see the very obvious problem in the above pattern. Then
you clearly do not (yet) know enough to be playing around with Store-ID.


First you need to know regex VERY well. Mistakes here are far, far more
dangerous than most other uses of regex.


Secondly you need to know the Store-ID documentation before you get
screwed over too much more:
 <http://wiki.squid-cache.org/Features/StoreID>

Pay attention to the "Known Issues" section. The first items there in
particular.

It is absolutely critical that the objects at the URL being
de-duplicated really are *identical* objects.


Smashing every .exe on the whole Internet into one cache slot then
delivering whatever random one got cached earlier, on each subsequent
.exe URL request ... is not exactly a good thing to be doing.


Amos



More information about the squid-users mailing list