Search squid archive

Re: Inelegant routing based on file size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vernon Kennedy-Van Dam wrote:
Thanx very much Amos. Much appreciated with the feedback.


Hi All

I am looking to route download traffic based on file size of the download
requests. If a user in our network was to download a 10mb file, he gets
routed through link 1. If a user requests a 100mb file download, he gets
routed through link 2.

How is this achieved?

It can not. File size is not known until after the file starts arriving.
Sometimes not even until it has finished arriving.

The best you may possibly do is create a custom external ACL helper to
scan store.log for previous file sizes of requested URL. Then use
tcp_outgoing_address based on a best-guess.

This however breaks completely on:
* new and unknown URL,
*  changed URLs,
*  dynamic URL (very common!),
*  and most websites updated by their webmaster between your visits
    (almost as common as dynamic URLs).

Amos

Well, we used a rather complicated way to achive something similar - so it seems possible.

Use url_rewrite_program to redirect the request to an inspection script.

The inspection script then fetches the HTTP headers of the file to determine file size. If small enough or not indicated, the script returns the url untouched so that the local cache processes it.

If the file is larger, you can redirect to an alternate url/script that can do the fetching. The only thing I've not tested, is possibly making the redirect send to another proxy server, not entirely sure of that syntax.

But you get the general idea.



[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux