README-SQUID
------------

To integrate Squid with kav4proxy, the ICAP protocol support must be enabled.

1. Squid 2.5
============
The official release of Squid 2.5 does not support ICAP, but there is a project
based on Squid 2.5 that has ICAP implementation.

The Squid with ICAP support is available in icap-2_5 branch from Squid CVS server. 

The latest version of Squid 2.5 with ICAP support can be fetched using the
following commands:

    # cvs -d :pserver:anonymous@cvs.devel.squid-cache.org:/cvsroot/squid login
    Enter password: <Use empty password or anoncvs>
    # cvs -d :pserver:anonymous@cvs.devel.squid-cache.org:/cvsroot/squid checkout \
	-r icap-2_5 -d squid-icap-2_5 squid

To enable ICAP support, run 'configure' in the Squid sources directory with
'--enable-icap-support' option and then build:
    # ./configure --enable-icap-support
    # make

1.1. Workarounds for Squid 2.5
==============================
1) Under a heavy load, Squid considers an ICAP server to be unreachable from time to time,
but in fact the ICAP server handles requests.

You can find a patch to fix it in:
Linux distribution:
	/opt/kav/5.5/kav4proxy/share/doc/squid-icap-2_5-unreach.patch
FreeBSD distribution:
	/usr/local/share/kav/5.5/kav4proxy/share/doc/squid-icap-2_5-unreach.patch

After Squid 2.5 source code is fetched we recommend you to apply this patch using:
    # patch -p1 < squid-icap-2_5-unreach.patch

2) Broken REQMOD requests

You can find a patch to fix it in:
Linux distribution:
	/opt/kav/5.5/kav4proxy/share/doc/squid-icap-2_5-readlen.patch
FreeBSD distribution:
	/usr/local/share/kav/5.5/kav4proxy/share/doc/squid-icap-2_5-readlen.patch

After Squid 2.5 source code is fetched we recommend you to apply this patch using:
    # patch -p1 < squid-icap-2_5-readlen.patch

3) Version of Squid 2.5 ready to be used with KAVProxy 5.5

Here is a list of URLs with snapshot of Squid 2.5 with ICAP support and these patches applied:

    ftp://downloads1.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.5.CVS-20070129.tar.gz
    ftp://downloads2.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.5.CVS-20070129.tar.gz
    ftp://downloads3.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.5.CVS-20070129.tar.gz
    ftp://downloads4.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.5.CVS-20070129.tar.gz

We tested a product using this Squid 2.5 snapshot. 


2. Squid 2.6
============
The official release of Squid 2.6 does not support ICAP, but there is a project
based on Squid 2.6 that has ICAP implementation.

The Squid with ICAP support is available in icap-2_6 branch from Squid CVS server. 

The latest version of Squid 2.6 with ICAP support can be fetched using the
following commands:

    # cvs -d :pserver:anonymous@cvs.devel.squid-cache.org:/cvsroot/squid login
    Enter password: <Use empty password or anoncvs>
    # cvs -d :pserver:anonymous@cvs.devel.squid-cache.org:/cvsroot/squid checkout \
	-r icap-2_6 -d squid-icap-2_6 squid

To enable ICAP support, run 'configure' in the Squid sources directory with
'--enable-icap-support' option and then build:
    # ./configure --enable-icap-support
    # make


2.1. Workarounds for Squid 2.6
==============================
1) Under a heavy load, Squid considers an ICAP server to be unreachable from
time to time,
but in fact the ICAP server handles requests.

You can find a patch to fix it in:
Linux distribution:
	/opt/kav/5.5/kav4proxy/share/doc/squid-icap-2_5-unreach.patch
FreeBSD distribution:
	/usr/local/share/kav/5.5/kav4proxy/share/doc/squid-icap-2_5-unreach.patch

After Squid 2.5 source code is fetched we recommend you to apply this patch
using:
    # patch -p1 < squid-icap-2_5-unreach.patch

2) Incorrect synchronization between HTTP and ICAP. When Squid process an HTTP object with the considerable size,
and ICAP support is turned on - there is a lag in the object processing. It causes performance downgrade.

You can find a patch to fix it in:
Linux distribution:
	/opt/kav/5.5/kav4proxy/share/doc/squid-icap-2_6-http_resume.patch
FreeBSD distribution:
	/usr/local/share/kav/5.5/kav4proxy/share/doc/squid-icap-2_6-http_resume.patch

After Squid 2.6 source code is fetched we recommend you to apply this patch
using:
    # patch -p1 < squid-icap-2_6-http_resume.patch


3) Incorrect handling lengthy HTTP requests. If an HTTP request transmited through Squid - and this request has considerable length,
there is a lag in the processing. This request passed to client with lags. 

You can find a patch to fix it in:

Linux distribution:
        /opt/kav/5.5/kav4proxy/share/doc/squid-icap-2_6-client_side.patch
        FreeBSD distribution:
        /usr/local/share/kav/5.5/kav4proxy/share/doc/squid-icap-2_6-client_side.patch
                
After Squid 2.6 source code is fetched we recommend you to apply this patch
using:
    # patch -p1 < squid-icap-2_6-client_side.patch
                    
4) Version of Squid 2.6 ready to be used with KAVProxy 5.5

Here is a list of URLs with snapshot of Squid 2.6 with ICAP support and these
patches applied:

    ftp://downloads1.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.6.CVS-20070129.tar.gz
    ftp://downloads2.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.6.CVS-20070129.tar.gz
    ftp://downloads3.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.6.CVS-20070129.tar.gz
    ftp://downloads4.kaspersky-labs.com/products/release/english/businessoptimal/i_gateways/proxyserver/squid-icap-2.6.CVS-20070129.tar.gz

We tested a product using this Squid 2.6 snapshot. 


3. Squid 3.0
============
The official version of Squid 3.0 has ICAP support.

The latest snapshots are available at http://www.squid-cache.org/Versions/v3/3.0/

To turn on ICAP support, run 'configure' in the Squid sources directory with
'--enable-icap-client' option and then build:
    # ./configure --enable-icap-client
    # make
