Re: [squid-users] Re: Automatic StoreID ?

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Fri, 14 Mar 2014 09:40:29 -0600

On 03/14/2014 02:36 AM, Eliezer Croitoru wrote:
> Adding a domain or acl test for internal squid StoreID feature to allow
> it run faster but with a patch to the sources.
>
> I was thinking about adding the code to the StoreID reply section on a
> ERR case while another flag is being used to allow this option and note
> that it will not work when using an external helper.

You can add a new store_id_map directive. I do not think it should
depend on store_id_program actions. The two options do not even have to
be mutually exclusive: if store_id_map does not match, check
store_id_access.

  store_id_map <filename with a regex map> acl1 acl2 ...

> how a about reading the perl DB into squid internals?

If you do something like that, I urge you to revise the current regex
map file syntax used by a popular StoreID script to allow for comments
(if not already allowed) and to contain complete substitution patterns
instead of space-separated from/to tokens:

    # comment
    s/replace this/with that/flags
    s_at_can use custom delimiters and other regex features_at_as needed_at_g
    ^this line is an invalid line example$

To minimize confusion, you can even require that the map file starts
with some well-defined prefix. For example:

  #Store ID Map
  #Version: 1.0

This approach will allow this feature to evolve as needed.

> What exists inside squid code that can help me work with regex
> extraction and match stuff?
> maybe use an acl like code?
>
> pointers are welcome.

  $ fgrep -RI regcomp src

HTH,

Alex.
Received on Fri Mar 14 2014 - 15:40:46 MDT

This archive was generated by hypermail 2.2.0 : Sat Mar 15 2014 - 12:00:05 MDT