Re: ESI

From: Joe Cooper <joe@dont-contact.us>
Date: Wed, 16 Mar 2005 10:55:11 -0600

Hey Michael,

Hmmm...OK, so the build error does look like just an incompatibility
when expat and libxml2 are available on the same system (they step on
each others definitions, as would be expected of libraries that do the
same thing). I don't know the autotools incantations well enough to do
anything about it at the moment, but I suspect it would be reasonably
easy to add a selector at configure time to choose the library with a
default to libxml2, since it seems the best supported at this time (but
I could be wrong--again, I'm not terribly familiar with ESI or the Squid
implementation...I'm learning just like you). There are already dozens
of such library tests in the configure script, so adding a new one
should be cut and paste with minor modifications...but again, the
autotools are a mystery to me, so I might be off my rocker.

I'll look into it when I get some free time, maybe later today, but I
wouldn't bet on my actually solving it. ;-)

On the not caching question, I don't have any way to test at the moment,
so I won't be tackling that one today.

Michal Pietrusinski wrote:
> Dear Joe,
>
> Today I have spent next day on trying to use ESI in squid.
>
> Here are the problems I have during compilation:
> ----------------------------------------------------------------------
> if g++ -DHAVE_CONFIG_H
> -DDEFAULT_CONFIG_FILE=\"/home/mpietrus/squid1/etc/squid.conf\" -I. -I.
> -I../include -I. -I. -I../include -I../include -I../lib/libTrie/include
> -I../lib/cppunit-1.10.0/include -I ../lib/cppunit-1.10.0/include
> -I/home/mpietrus/libxml2/include/libxml2 -Werror -Wall -Wpointer-arith
> -Wwrite-strings -Wcomments -g -O2 -MT ESILibxml2Parser.o -MD -MP -MF
> ".deps/ESILibxml2Parser.Tpo" \
> -c -o ESILibxml2Parser.o `test -f 'ESILibxml2Parser.cc' || echo
> './'`ESILibxml2Parser.cc; \
> then mv -f ".deps/ESILibxml2Parser.Tpo" ".deps/ESILibxml2Parser.Po"; \
> else rm -f ".deps/ESILibxml2Parser.Tpo"; exit 1; \
> fi
> if g++ -DHAVE_CONFIG_H
> -DDEFAULT_CONFIG_FILE=\"/home/mpietrus/squid1/etc/squid.conf\" -I. -I.
> -I../include -I. -I. -I../include -I../include -I../lib/libTrie/include
> -I../lib/cppunit-1.10.0/include -I ../lib/cppunit-1.10.0/include
> -I/home/mpietrus/libxml2/include/libxml2 -Werror -Wall -Wpointer-arith
> -Wwrite-strings -Wcomments -g -O2 -MT ESIParser.o -MD -MP -MF
> ".deps/ESIParser.Tpo" \
> -c -o ESIParser.o `test -f 'ESIParser.cc' || echo './'`ESIParser.cc; \
> then mv -f ".deps/ESIParser.Tpo" ".deps/ESIParser.Po"; \
> else rm -f ".deps/ESIParser.Tpo"; exit 1; \
> fi
> In file included from
> /home/mpietrus/libxml2/include/libxml2/libxml/xmlversion.h:13,
> from
> /home/mpietrus/libxml2/include/libxml2/libxml/parser.h:15,
> from ESILibxml2Parser.h:50,
> from ESIParser.cc:40:
> /home/mpietrus/libxml2/include/libxml2/libxml/xmlexports.h:42:1:
> "XMLCALL" redefined
> In file included from ESIExpatParser.h:37,
> from ESIParser.cc:38:
> /usr/local/include/expat.h:49:1: this is the location of the previous
> definition
> make[3]: *** [ESIParser.o] Error 1
> make[3]: Leaving directory `/home/mpietrus/tmp/squid-3.0-PRE3-20050228/src'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/home/mpietrus/tmp/squid-3.0-PRE3-20050228/src'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/mpietrus/tmp/squid-3.0-PRE3-20050228/src'
> make: *** [all-recursive] Error 1
> --------------------------------------------------------------------------
>
>
> I managed with that problem by removing all expat dependencies - in fact
> I made 2 compilations: one with support to expat and the other which
> supports libxml2.
>
> Libxml2 version is very sensitive on the format of the template files -
> it throws a lot of parser errors. I ran my templates through W3C XHTML
> validator and corrected all problems, but libxml2 still complained.
> So finally I moved to using the custom parser.
>
> With custom parser everything seems ok at first look (and only for
> simple pages). Pages are composed fine. The problem is that they are not
> taken from the cache but from the application server (JBoss 3.2.6). I
> can see it in the access.log and also by tracing the network traffic.
> When I killed the Jboss, then squid served files from the cache.
>
> I did the testing with firefox and wget, to be sure nothing is cached by
> the client.
>
> The template and fragment files have the following header:
> HTTP/1.1 200 OK
> X-Powered-By: Servlet 2.4; Tomcat-5.0.28/JBoss-3.2.6 (build:
> CVSTag=JBoss_3_2_6 date=200410140106)
> Surrogate-Control: max-age=1800, content="ESI/1.0"
> ETag: W/"513-1110451200000"
> Last-Modified: Thu, 10 Mar 2005 10:40:00 GMT
> Content-Type: text/html
> Content-Length: 513
> Date: Thu, 10 Mar 2005 12:24:55 GMT
> Server: Apache-Coyote/1.1
> Connection: Keep-Alive
>
>
> Below I put some fragments of log files:
>
>
> [mpietrus@elhep1 logs]$ tail access.log
> 1110468354.979 0 213.241.34.210 TCP_REFRESH_HIT/200 3245 GET
> http://localhost:8080/rpctlinks/script/content.css - NONE/- text/css
> 1110468356.935 0 213.241.34.210 TCP_REFRESH_HIT/200 3227 GET
> http://localhost:8080/rpctlinks/images/CERNLogo.png - NONE/- image/png
> 1110468356.935 0 213.241.34.210 TCP_MISS/503 2422 GET
> http://localhost:8080/favicon.ico - NONE/- text/html
> 1110468474.664 2 255.255.255.255 TCP_REFRESH_HIT/200 0 GET
> http://localhost:8080/rpctlinks/esi/header.html - NONE/- text/html
> 1110468474.664 2 255.255.255.255 TCP_REFRESH_HIT/200 0 GET
> http://localhost:8080/rpctlinks/esi/leftmenu.html - NONE/- text/html
> 1110468474.665 1 255.255.255.255 TCP_REFRESH_HIT/200 0 GET
> http://localhost:8080/rpctlinks/esi/body.html - NONE/- text/html
> 1110468476.669 363 213.241.34.210 TCP_REFRESH_HIT/200 3245 GET
> http://localhost:8080/rpctlinks/script/content.css - NONE/- text/css
> 1110468476.670 2227 213.241.34.210 TCP_REFRESH_HIT/200 16632 GET
> http://localhost:8080/rpctlinks/esi/template.html - NONE/- text/html
> 1110468478.462 566 213.241.34.210 TCP_REFRESH_HIT/200 3227 GET
> http://localhost:8080/rpctlinks/images/CERNLogo.png - NONE/- image/png
> 1110468481.464 0 213.241.34.210 TCP_MISS/503 2422 GET
> http://localhost:8080/favicon.ico - NONE/- text/html
>
>
>
>
>
> [mpietrus@elhep1 logs]$ tail cache.log
> 2005/03/10 16:27:56| never_direct = 0
> 2005/03/10 16:27:56| timedout = 0
> 2005/03/10 16:27:57| Failed to select source for
> 'http://localhost:8080/rpctlinks/images/CERNLogo.png'
> 2005/03/10 16:27:57| always_direct = 0
> 2005/03/10 16:27:57| never_direct = 0
> 2005/03/10 16:27:57| timedout = 0
> 2005/03/10 16:28:01| Failed to select source for
> 'http://localhost:8080/favicon.ico'
> 2005/03/10 16:28:01| always_direct = 0
> 2005/03/10 16:28:01| never_direct = 0
> 2005/03/10 16:28:01| timedout = 0
>
>
> [mpietrus@elhep1 logs]$ tail store.log
> 1110468354.979 RELEASE -1 FFFFFFFF 608899516D23CFDF7FE69465AEEDA83D 503
> 1110468354 0 1110468354 text/html 2254/2254 GET
> http://localhost:8080/rpctlinks/script/content.css
> 1110468356.934 RELEASE -1 FFFFFFFF F2BE2CCA30C79B49138C879925B75950 503
> 1110468356 0 1110468356 text/html 2258/2258 GET
> http://localhost:8080/rpctlinks/images/CERNLogo.png
> 1110468356.935 RELEASE -1 FFFFFFFF A4D18CABC953D3A6081E7A56D2FACFD7 503
> 1110468356 0 1110468356 text/html 2049/2049 GET
> http://localhost:8080/favicon.ico
> 1110468474.444 RELEASE -1 FFFFFFFF 5EF4E255EBFCBB62D1BE8C2D92836B4B 503
> 1110468474 0 1110468474 text/html 2271/2271 GET
> http://localhost:8080/rpctlinks/esi/template.html
> 1110468474.662 RELEASE -1 FFFFFFFF 7FA3985250F9D971AC5AD880FA862B80 503
> 1110468474 0 1110468474 text/html 2208/2208 GET
> http://localhost:8080/rpctlinks/esi/header.html
> 1110468474.663 RELEASE -1 FFFFFFFF 4AE40C3C89D2C156F4DD9DFD6FBD873D 503
> 1110468474 0 1110468474 text/html 2214/2214 GET
> http://localhost:8080/rpctlinks/esi/leftmenu.html
> 1110468474.664 RELEASE -1 FFFFFFFF FD26621635007DE60A100E2D388F27F8 503
> 1110468474 0 1110468474 text/html 2202/2202 GET
> http://localhost:8080/rpctlinks/esi/body.html
> 1110468476.306 RELEASE -1 FFFFFFFF 2C51D336BEB8A9E8A1BEE1E9066548F5 503
> 1110468476 0 1110468476 text/html 2254/2254 GET
> http://localhost:8080/rpctlinks/script/content.css
> 1110468477.897 RELEASE -1 FFFFFFFF 240F5EBB733E41EB2C249A815E85ADF3 503
> 1110468477 0 1110468477 text/html 2258/2258 GET
> http://localhost:8080/rpctlinks/images/CERNLogo.png
> 1110468481.464 RELEASE -1 FFFFFFFF 4C96709C9E96380F544019B134C89F6D 503
> 1110468481 0 1110468481 text/html 2049/2049 GET
> http://localhost:8080/favicon.ico
>
>
> I also set up a test server so that squid developers can test my setup.
> The template page can be accessed directly from the JBoss at:
> http://212.87.7.89:8080/rpctlinks/esi/template.html
> and through squid at
> http://212.87.7.89:8081/rpctlinks/esi/template.html
>
>
> I would be very grateful for some help.
>
> Michal Pietrusinski
>
>
>
>
> Joe Cooper napisaƂ(a):
>
>> Michal Pietrusinski wrote:
>>
>>> After compiling squid - which was not a simple task, as there are
>>> conflicts between expat and libxml2, squid does not cache anything
>>> but stylesheets and images.
>>
>>
>>
>> I don't have an opinion on whether ESI works, as I haven't tried it
>> (but I built it for a customer, and I suspect they will be trying it
>> soon if they haven't already), but I didn't have any problems building
>> it. I did have to explicitly add the include flag pointing to
>> /usr/include/libxml2, since that's where it hides on my Fedora Core 3
>> system, but I wouldn't say it wasn't simple to build. And that's
>> always been a requirement...similarly there was a kerberos library
>> issue in the past. Unavoidable side-effects of operating systems
>> making incompatible changes in their include file locations.
>>
>> Then again, I don't have expat installed on my system, as far as I
>> know. Perhaps forwarding your build errors will help get it fixed, if
>> there is a problem in the Squid build process. Since ESI will be
>> included in Squid 3.0 STABLE, I imagine everyone would like to see ESI
>> support build cleanly on any system that meets the dependencies.
>>
Received on Wed Mar 16 2005 - 09:53:32 MST

This archive was generated by hypermail pre-2.1.9 : Fri Apr 01 2005 - 12:00:04 MST