Happy for the responses. On 07/08/2013 09:34 AM, Alan wrote: > On Mon, Jul 8, 2013 at 6:25 AM, Eliezer Croitoru <eliezer@xxxxxxxxxxxx> wrote: >> try this if you want to try something new. >> https://github.com/elico/squid-helpers/blob/master/squid_helpers/store-id.pl >> >> Eliezer > > Hi Eliezer, > > I read your script, and I have a suggestion. > How about you store the matching urls in a separate file or database? Which I was thinking about long ago.. > That way the script would remain the same even if some website changes > their url scheme. When the squid admin wants to update the file/db he > can just issue squid -k reconfigure and the script would reload the > file/db. This is what happens today actually when you reload and use a new script. > > I just came up with this simple script, based on yours. I haven't > tested it though, since 3.4 head segfaults for me (btw, which revision > are you using?). # squid -v Squid Cache: Version 3.HEAD-20130520-r12839 configure options: '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--exec_prefix=/usr' '--libexecdir=/usr/lib64/squid' '--localstatedir=/var' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--with-logdir=$(localstatedir)/log/squid' '--with-pidfile=$(localstatedir)/run/squid.pid' '--disable-dependency-tracking' '--enable-eui' '--enable-follow-x-forwarded-for' '--enable-auth' '--enable-auth-basic=DB,LDAP,MSNT,MSNT-multi-domain,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB,getpwnam' '--enable-auth-ntlm=smb_lm,fake' '--enable-auth-digest=file,LDAP,eDirectory' '--enable-auth-negotiate=kerberos,wrapper' '--enable-external-acl-helpers=wbinfo_group,kerberos_ldap_group,AD_group' '--enable-cache-digests' '--enable-cachemgr-hostname=localhost' '--enable-delay-pools' '--enable-epoll' '--enable-icap-client' '--enable-ident-lookups' '--enable-linux-netfilter' '--enable-removal-policies=heap,lru' '--enable-snmp' '--enable-ssl' '--enable-storeio=aufs,diskd,ufs' '--enable-wccpv2' '--enable-esi' '--with-aio' '--with-default-user=squid' '--with-filedescriptors=16384' '--with-dl' '--with-pthreads' '--enable-ecap' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpie' 'LDFLAGS=-pie' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpie' 'PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig' > > The invocation for my script should be, for example: > store_id_program /etc/squid/storeid.pl /etc/squid/storeid.txt > > By the way, thanks for your contributions in this mailing list, they > are very helpful. I am working on a new document which will describe squid internals that have been used in order to allow StoreID. Since I am good at patterns your examples are helpful but I am working on other things I wouldn't be able to design the DB in a sec. Eliezer > > Best regards, > > Alan > > PS: Had to resend to the mailing list because it doesn't allow attachments. > Here are the attachments: > > storeid.pl script: > http://pastebin.ca/2420563 > > storeid.txt file: > http://pastebin.ca/2420565 >