[squid-users] How to use the different Store ID with same url and different proxy port ?

Amos Jeffries squid3 at treenet.co.nz
Tue Dec 1 10:46:10 UTC 2015


On 1/12/2015 5:44 p.m., 风声 wrote:
> Hi,
> 
> We want to Squid-3 to listen serveral ports (like 3128/3129/3120/...), but
> we want reply different cached objects for different ports with same
> request (same url),

Don't. URL do not work that way.

RFC 3986 section 1.1.3:
" The term "Uniform Resource Locator" (URL) refers to the subset of URIs
that, in addition to identifying a resource, provide a means of locating
the resource by describing its primary access mechanism "

The URL tells Squid both what object to return, but also *how* it had to
have been fetched (if already cached) or to fetch (if not cached yet).


Neither of which has anything to do with what proxy port Squid is
receiving HTTP messages through.



> because we want to cache compressed objects for some
> ports.

Whether Squid stores a compressed or non-compressed or both objects
depends on what forms are actively negotiated between client and server.
Independent of the URL.


> 
> How can we do that ? we try to use store id configs in squid.conf, but
> looks like it does not work.
> 

Store-ID does not work that way either. All it says is what ID Squid is
to use internally for the URL. It has nothing to do with either the type
of object, nor with what listening port was involved.


> 
> squid --> ziproxy --------> websites
>           \----------------------> websites
> 
> or we just only can do is setup multiple squid instances in same servers
>  to listen different ports ?
> 

What are you *really* trying to do? I mean the end product goal, not
just the "serve compressed and non-compressed on different ports"
halfway step. That is just a halfway step towards a badly designed end
product.

If you place ziproxy between Squid and web servers you will get
compressed objects.

You can achieve the same by having Squid emit headers stating that only
compressed objects are acceptible. The web servers themselves then do
the compression, no need for ziproxy AFAICS.

Amos



More information about the squid-users mailing list