[squid-users] ICAP and Allow 204 Header
Alex Rousskov
rousskov at measurement-factory.com
Mon Jan 25 21:32:40 UTC 2016
On 01/25/2016 10:28 AM, Gilles Bardouillet wrote:
> I'm using SQUID with CAS ICAP Server but I have one issue :
>
> * for some images, squid receive icap error as ICAP_ERR_OTHER
It may be useful to know more details about that ICAP error. What ICAP
response, if any, does Squid receive when it generates ICAP_ERR_OTHER?
> * I noticed that for all these errors, Squid dont send the HTTP header
> Allows 204
Allow:204 is not an HTTP header field. It is an ICAP header field.
> * I read the code and find the Allow 204 header _is only set when
> preview is enabled_.
Are you sure? Several factors affect ICAP Allow:204 request header
presence. Preview availability should not be one of them because
Allow:204 is about 204 responses _outside_ of Preview. See RFC 3507
Section 4.6.
> My icap conf activated preview and preview size as follow :
> icap_preview_enable on
> icap_preview_size 1024
IIRC, Squid ignores icap_preview_size in squid.conf (a bug). The ICAP
service OPTIONS response determines the Preview size (subject to an
internal limit of 64KB).
> I read that the preview size value can be overwritten by OPTIONS
> requests, so can give me some details, hints in order to find why some
> pictures dont offer preview and then fails ?
See RFC 3507 Section 4.5 for details on how Preview is negotiated. If
you think Squid violates the ICAP protocol, please file a bug report
with the corresponding capture of ICAP messages (from and to Squid).
As for ICAP 204 outside of Preview, I believe Squid can offer to support
that ICAP response if all of the checks below are successful:
* the origin server OPTIONS response includes Allow:204;
* the message content length is known at the ICAP request time; and
* the message content length does not exceed 64KB.
If you prefer to analyze the code, see
Adaptation::Icap::ModXact::shouldAllow204() and
Adaptation::Icap::ModXact::canBackupEverything().
HTH,
Alex.
More information about the squid-users
mailing list