[squid-users] Squid 3.0

From: Konrad <conradh@dont-contact.us>
Date: Tue, 04 Jan 2005 13:09:35 +0100

Hi all,

Few things about ESI in squid 3.0

1) It seems that squid HEAD version (squid-3.0-PRE3-20050103) doesn't
compile, out of box :), with esi-enabled.
There is a conflict between expat(1.95.7) and libxml2(2.6.16) parser -
redefinition of XMLCALL macro. I've attached small, rather tricky, patch
fixing this problem. There is also one strange thing with libxml2. It
installs header files in PREFIX/include/libxml2/libxml, and upon making
symbolic link libxml->libxml2/libxml, in the include directory,
compilation fails. Is it bug in libxml2 ?

2) The second thing is ESI caching algorithm. According to www.esi.org
spec, ESI fragments should be cached/considered fresh *max-age* seconds
plus additional/optional expiration period. The directives are stored in
'Surrogate-Control' http header. More or less :)
As I understand, this is the only caching rule which should apply on ESI
entities, but I've noticed that squid reacts also on ETag, Date,
Last-Modified, and Age headers from server, and Cache-control from client.

Scenario 1:
mozilla -> squid -> Jboss with Tomcat
Forcing squid to cache ESI entities requires setting "Date" header with
value set to max-age seconds in future, so the respons from appserver
needs to be something similar to:
HTTP...
Surrogate-Control: max-age=SOME_TIME
Date: THIS_MOMENT + SOME_TIME
...

Time synchronization between appserver and squid machine is required.

Scenario 2:
Tomcat by default adds ETag and Last-modified headers when it serves
static content, ie image fileas, *.css, or *.js. To convince squid to
cache those files I need to "zero" ETag and set Last-Modified into
future - similar as with Date.

Scenario 3:
mozilla (Ctrl+F5) -> squid - enforcing page reload with fresh content
Squid retrievs new content even though it have not yet expired.

The question is, are these behaviours correct ?

Regards
Konrad

--- ESIParser.cc 2005-01-03 19:37:30.000000000 +0100
+++ ESIParser-patched.cc 2005-01-03 19:38:19.000000000 +0100
@@ -35,9 +35,9 @@
 
 #include "squid.h"
 #include "ESIParser.h"
-#include "ESIExpatParser.h"
 #include "ESICustomParser.h"
 #include "ESILibxml2Parser.h"
+#include "ESIExpatParser.h"
 
 char *ESIParser::Type = NULL;
 
Received on Tue Jan 04 2005 - 05:09:32 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 07 2005 - 12:59:35 MST