[Varnish] #705: ESI - turning off Accept-Encoding for ESI includes

Varnish varnish-bugs at varnish-cache.org
Thu May 20 22:57:55 CEST 2010


#705: ESI - turning off Accept-Encoding for ESI includes
-------------------------+--------------------------------------------------
 Reporter:  askalski     |       Owner:  phk     
     Type:  enhancement  |      Status:  new     
 Priority:  normal       |   Milestone:          
Component:  varnishd     |     Version:  2.1.1   
 Severity:  normal       |    Keywords:  esi gzip
-------------------------+--------------------------------------------------
 I'm configuring ESI for specific pages within my site, and ran into
 difficulty with disabling gzip compression for both the main request, and
 all includes.

 {{{
 sub vcl_recv {
     if (req.url == "/file/with/esi/includes.css") {
         # Prevent the backend from compressing the main file,
         # otherwise it can't be ESI-processed.
         #
         # However, because the session 'req.http' workspace gets
         # rolled back before each include, this setting will
         # get obliterated, and each of the included chunks will
         # come back compressed by the backend.
         #
         unset req.http.Accept-Encoding;
     }
 }

 sub vcl_fetch {
     if (req.url == "/file/with/esi/includes.css") {
         # Run ESI processing on the special ESI-enabled file(s)
         esi;
     }
 }
 }}}


 As far as I can tell, there is no flag that I can check in vcl_recv() to
 determine if it's processing an ESI include:

 {{{
 if (req.is_esi_include) { # hypothetical flag
     unset req.http.Accept-Encoding;
 }
 }}}

 And there doesn't seem to be any way to access/modify the master copy
 (sp->http0) without dropping into C (and even that might not be possible
 without varnishd's private includes.

 {{{
 unset req.http0.Accept-Encoding;
 }}}

 {{{
 C{
     http_Unset(sp->http0,
                H_Accept_Encoding);
 }C

 ./vcl.N9K6Q6Az.c: In function ‘VGC_function_vcl_recv’:
 ./vcl.N9K6Q6Az.c:789: error: dereferencing pointer to incomplete type
 ./vcl.N9K6Q6Az.c:790: error: ‘H_Accept_Encoding’ undeclared (first use in
 this function)
 }}}

-- 
Ticket URL: <http://varnish-cache.org/ticket/705>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list