{"id":837,"date":"2009-12-01T23:26:49","date_gmt":"2009-12-02T03:26:49","guid":{"rendered":"http:\/\/cd34.com\/blog\/?p=837"},"modified":"2009-12-02T00:30:38","modified_gmt":"2009-12-02T04:30:38","slug":"no-esi-processing-first-char-not","status":"publish","type":"post","link":"https:\/\/cd34.com\/blog\/infrastructure\/no-esi-processing-first-char-not\/","title":{"rendered":"No ESI processing, first char not &#8216;<'"},"content":{"rendered":"<p>After installing Varnish 2.0.5 on a machine, ESI Includes didn&#8217;t work.  When using varnishlog, the first error that occurred when debugging was:<\/p>\n<p>No ESI processing, first char not &#8216;< '\n\n\n\n<pre>\r\n   12 SessionClose &#8211; timeout\r\n   12 StatSess     &#8211; 124.177.181.149 50662 4 0 0 0 0 0 0 0\r\n   12 SessionOpen  c 68.212.183.136 60087 66.244.147.44:80\r\n   12 ReqStart     c 68.212.183.136 60087 409391565\r\n   12 RxRequest    c GET\r\n   12 RxURL        c \/esi.html\r\n   12 RxProtocol   c HTTP\/1.1\r\n   12 RxHeader     c Host: cd34.colocdn.com\r\n   12 RxHeader     c User-Agent: Mozilla\/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2b4) Gecko\/20091124 Firefox\/3.6b4\r\n   12 RxHeader     c Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8\r\n   12 RxHeader     c Accept-Language: en-us,en;q=0.5\r\n   12 RxHeader     c Accept-Encoding: gzip,deflate\r\n   12 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n   12 RxHeader     c Keep-Alive: 115\r\n   12 RxHeader     c Connection: keep-alive\r\n   12 RxHeader     c X-lori-time-1: 1259718658980\r\n   12 RxHeader     c Cache-Control: max-age=0\r\n   12 VCL_call     c recv\r\n   12 VCL_return   c lookup\r\n   12 VCL_call     c hash\r\n   12 VCL_return   c hash\r\n   12 VCL_call     c miss\r\n   12 VCL_return   c fetch\r\n   12 Backend      c 14 cd34_com cd34_com\r\n   12 ObjProtocol  c HTTP\/1.1\r\n   12 ObjStatus    c 200\r\n   12 ObjResponse  c OK\r\n   12 ObjHeader    c Date: Wed, 02 Dec 2009 01:50:59 GMT\r\n   12 ObjHeader    c Server: Apache\r\n   12 ObjHeader    c Vary: Accept-Encoding\r\n   12 ObjHeader    c Content-Encoding: gzip\r\n   12 ObjHeader    c Content-Type: text\/html\r\n   12 TTL          c 409391565 RFC 120 1259718659 0 0 0 0\r\n   12 VCL_call     c fetch\r\n   12 TTL          c 409391565 VCL 43200 1259718659\r\n   12 ESI_xmlerror c No ESI processing, first char not &#8216;< '\r\n   12 TTL          c 409391565 VCL 0 1259718659\r\n   12 VCL_info     c XID 409391565: obj.prefetch (-30) less than ttl (-1), ignored.\r\n   12 VCL_return   c deliver\r\n   12 Length       c 68\r\n   12 VCL_call     c deliver\r\n   12 VCL_return   c deliver\r\n   12 TxProtocol   c HTTP\/1.1\r\n   12 TxStatus     c 200\r\n   12 TxResponse   c OK\r\n   12 TxHeader     c Server: Apache\r\n   12 TxHeader     c Vary: Accept-Encoding\r\n   12 TxHeader     c Content-Encoding: gzip\r\n   12 TxHeader     c Content-Type: text\/html\r\n   12 TxHeader     c Content-Length: 68\r\n   12 TxHeader     c Date: Wed, 02 Dec 2009 01:50:59 GMT\r\n   12 TxHeader     c X-Varnish: 409391565\r\n   12 TxHeader     c Age: 0\r\n   12 TxHeader     c Via: 1.1 varnish\r\n   12 TxHeader     c Connection: keep-alive\r\n   12 TxHeader     c X-Cache: MISS\r\n   12 ReqEnd       c 409391565 1259718659.088263512 1259718659.127703667 0.000059366 0.039401770 0.000038385\r\n   12 Debug        c \"herding\"\r\n<\/pre>\n<p>ESI received significant performance enhancements in 2.0.4 and 2.0.5 so, it seemed something was incompatible.  Downgrading to 2.0.3 and using the VCL from another machine still resulted in ESI not working.<\/p>\n<p>In this case, mod_deflate was running on the backend which was causing the issue.  However, in reading the source code, it appears that message could also occur if your ESI include wasn&#8217;t handing back properly formed XML\/HTML content.  If your include doesn&#8217;t contain valid content and is only returning a small snippet, you might consider passing:<\/p>\n<pre>\r\n-p esi_syntax=0x1\r\n<\/pre>\n<p>on the command line that starts Varnish.<\/p>\n<p>The changes in Varnish address the issue of ESI being enabled on binary content.  Since the first character isn&#8217;t an < in almost all binary files (jpg, mpg, gif) and isn't the start of most .css\/.js files, varnish doesn't need to spend extra time checking those files for includes.  While you can and should selectively enable esi processing, this is just an added safeguard and a performance boost to compensate for vcl that might have an esi directive on static\/binary content.\n\nSince Varnish 2.0.3 now worked properly with the new machine, we upgraded to Varnish 2.0.5 which introduced a very odd issue:\n\n\n\n<pre>\r\n[Tue Dec 01 20:58:11 2009] [error] [client 66.244.147.40] File does not exist: \/gfs\/www\/cd\/cd34.com\/index.htmlt\r\n[Tue Dec 01 20:58:13 2009] [error] [client 66.244.147.40] File does not exist: \/gfs\/www\/cd\/cd34.com\/index.html7\r\n[Tue Dec 01 20:58:24 2009] [error] [client 66.244.147.40] File does not exist: \/gfs\/www\/cd\/cd34.com\/index.html\\xfa\r\n[Tue Dec 01 20:59:01 2009] [error] [client 66.244.147.40] File does not exist: \/gfs\/www\/cd\/cd34.com\/index.html\\xb5\r\n[Tue Dec 01 20:59:06 2009] [error] [client 66.244.147.40] File does not exist: \/gfs\/www\/cd\/cd34.com\/index.html\\xe7\r\n[Tue Dec 01 20:59:07 2009] [error] [client 66.244.147.40] File does not exist: \/gfs\/www\/cd\/cd34.com\/index.html\\xd4\r\n[Tue Dec 01 20:59:08 2009] [error] [client 66.244.147.40] File does not exist: \/gfs\/www\/cd\/cd34.com\/index.html\\x1c<\/pre>\n<p>This generated 404s on the piece of the page that contained the ESI include.  Downgrading to 2.0.4 fixed the issue and the issue appears to already be fixed in Trunk.  <a href=\"http:\/\/varnish.projects.linpro.no\/ticket\/585\">Varnish Ticket #585<\/a><\/p>\n<p>Varnish 2.0.4 and mod_deflate disabled addressed the two issues that prevented ESI from working correctly on this new installation.<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/infrastructure\/no-esi-processing-first-char-not\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>After installing Varnish 2.0.5 on a machine, ESI Includes didn&#8217;t work. When using varnishlog, the first error that occurred when debugging was: No ESI processing, first char not &#8216;< ' 12 SessionClose &#8211; timeout 12 StatSess &#8211; 124.177.181.149 50662 4 0 0 0 0 0 0 0 12 SessionOpen c 68.212.183.136 60087 66.244.147.44:80 12 ReqStart [&hellip;]\n<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/infrastructure\/no-esi-processing-first-char-not\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[89,65,21],"class_list":["post-837","post","type-post","status-publish","format-standard","hentry","category-infrastructure","tag-edge-side-include","tag-esi","tag-varnish"],"_links":{"self":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/comments?post=837"}],"version-history":[{"count":12,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/837\/revisions"}],"predecessor-version":[{"id":849,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/837\/revisions\/849"}],"wp:attachment":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/media?parent=837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/categories?post=837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/tags?post=837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}