[squid-dev] Proposal: Helper response: concatenated values with custom delimiter

Amos Jeffries squid3 at treenet.co.nz
Wed Apr 29 04:55:28 UTC 2026


On 28/04/2026 20:37, Andrey K wrote:
> Hello, Amos and Alex,
> 
> Thank you for sharing your thoughts on this.
> 
> On my part, I see two reasons for implementing support for the 
> key=v1,v2,v3 format:
> 
> 1. As Amos pointed out in the previous email, using this format will 
> reduce the volume of traffic sent from the helper, thereby reducing the 
> processing overhead.
> However, the impact will be marginal; for 300 groups, the savings would 
> be roughlylen("group=") * 300 = 1800 bytes.
> It would be far more efficient to filter groups during PAC record 
> parsing. This filtering should be performed as early as possible to 
> prevent further processing of unused groups. I intend to spin this 
> suggestion off into a separate discussion thread.


That calculation is focused on a single transaction. The math at that 
level was used to prove that there is an overall savings gained by this 
feature.

I did not expand the math into further scopes because the trend is 
already proven at that level. For clarity I shall do so now;

We do not need a large number of groups to benefit at the aggregate 
levels. Whenever the number of "group=" is G>2, savings will accumulate; 
with the G=0,1 cases being neutral vis' status quo.

With a demonstrated savings of N=(strlen(" group=") >= 7) 
per-transaction leads to a T*N savings at the large scale where T is the 
transaction count over the future lifetime of Squid.


IMO, the suggested PAC filtering by the helper is a different mechanism 
that can be applied alongside the protocol syntax. For additional 
savings when someone implements it.


> 
> 2. Annotation of client connections. Currently, only one tag is 
> supported for client connection annotation: clt_conn_tag, and the 
> current handler for this tag does not support multiple occurrences of 
> the same tag in the helper response.
> However, this issue is elegantly addressed by Amos's PR (https:// 
> github.com/squid-cache/squid/pull/2399/ <https://github.com/squid-cache/ 
> squid/pull/2399/>) and my proposal to use NotePairs filtering (https:// 
> github.com/squid-cache/squid/pull/2399/#issuecomment-4224381496 
> <https://github.com/squid-cache/squid/pull/2399/#issuecomment-4224381496>).
> 
> Additionally, custom helpers already have the flexibility to return 
> values in the key=v1,v2,v3 format, allowing users to retrieve specific 
> values using the-m=, option.
> 
> Furthermore, I’ve reconsidered the use of a comma as a default value 
> separator in helper responses. It seems like a poor choice because we 
> wouldn't be able to distinguish whether the comma is a separator or part 
> of the token itself.
> 
> 
> Therefore, I suggest we close this proposal for now and wait for the 
> completion of PR#2399.
> 
> Kind regards,
>       Ankor.
> 

HTH
Amos


More information about the squid-dev mailing list