[squid-users] Speed ​​limit from file size

Alex Rousskov rousskov at measurement-factory.com
Mon Jun 25 16:35:38 UTC 2018

On 06/24/2018 11:32 AM, Michael Pro wrote:
> In store_id_program, I use the third-party utility "curl -sI
> http://url.to/real.file.zip"
> to define Content-Length and return to squid using the "note" mechanism
> in the desired ACL for response_delay_pool_access.

> Could not you do this with the help of squid itself?

I see two ways to interpret your question:

A) Is it possible for my curl probing requests to go through Squid?

Sure, curl supports HTTP and HTTPS proxies. Just add ACLs that would
detect and treat your curl requests specially (e.g., avoid sending them
back to the store_id_program and do not cache their responses).

B) Is it possible for Squid itself to initiate probing requests?

Yes, it is possible to modify Squid to send probing requests that would
determine the expected response content length. Probing requests are
costly (you double network traffic in many cases and block the user
while the probe runs). Probes are also difficult to implement correctly
(see Amos response for some of the complications).

If you want to implement probing in Squid, and want your changes to be
officially accepted, then please discuss your design (on squid-dev)
before implementing anything -- many designs are likely to be rejected
for the reasons mentioned above.



> пт, 22 июн. 2018 г. в 18:22, Alex Rousskov <rousskov at measurement-factory.com>:
>> On 06/21/2018 10:34 PM, Michael Pro wrote:
>>> I put all the necessary links in the database in step #2.
>>> I'm quite satisfied with entering this value (Content-Length) after step #3.
>>> How can I update the data for the link?
>> I am not sure I understand the question, but if you are asking how to
>> add response Content-Length info to some external database, then you
>> have a few options, including:
>> 1. An external ACL used with http_reply_access
>>    (gets notified after receiving response headers)
>>    http://www.squid-cache.org/Doc/config/http_reply_access/
>> 2. An access.log daemon (gets notified after response delivery)
>> 3. An access.log parser (gets notified after response delivery
>>    and log flushing)
>> Alex.
>>> чт, 21 июн. 2018 г. в 22:52, Alex Rousskov <rousskov at measurement-factory.com>:
>>>> On 06/21/2018 12:08 PM, Michael Pro wrote:
>>>>> чт, 21 июн. 2018 г. в 19:09, Alex Rousskov <rousskov at measurement-factory.com>:
>>>>>> ...
>>>>>> You may prefer response delay pools, but they are only available in v5:
>>>>>> https://github.com/squid-cache/squid/commit/b27668e
>>>>> But to use this I understood that I need to use the store_id_program mechanism.
>>>> There is no relationship between response delay pools and Store IDs.
>>>>> A related question is how to pass the size (Content-Length) to store_id_extras.
>>>> You cannot pass response Content-Length header to the store_id_program
>>>> because that helper is consulted _before_ there is a response (step #2):
>>>>   1. parse client request X
>>>>   2. adapt X into request Y (ICAP, eCAP, url_rewriter, store_id, etc.)
>>>>   3. get the resource requested by Y
>>>>      (from the cache, peer, or origin server)
>>>> HTH,
>>>> Alex.
>>> _______________________________________________
>>> squid-users mailing list
>>> squid-users at lists.squid-cache.org
>>> http://lists.squid-cache.org/listinfo/squid-users
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users

More information about the squid-users mailing list