[Varnish] #122: Varnish caches wrong resources

Varnish varnish-bugs at projects.linpro.no
Fri Jun 29 15:04:11 CEST 2007


#122: Varnish caches wrong resources
----------------------+-----------------------------------------------------
 Reporter:  RuddO     |        Owner:  phk          
     Type:  defect    |       Status:  reopened     
 Priority:  normal    |    Milestone:  Varnish 1.0.4
Component:  varnishd  |      Version:  trunk        
 Severity:  normal    |   Resolution:               
 Keywords:            |  
----------------------+-----------------------------------------------------
Changes (by RuddO):

  * status:  closed => reopened
  * resolution:  wontfix =>

Comment:

 1) I didn't swear at the developers.

 2) How is a "random sometimes cache and sometimes not, then don't obey
 client Pragmas" issue a *configuration* issue?

 Varnish should only mark objects as cacheable when they are actually
 *cacheable*, (ETag, perhaps Last-Modified, Expires header sent back), and
 it surely must NOT deliver objects from cache when the Pragma: no-cache
 header is sent by the browser.

 Even if were this a configuration problem, the default configuration
 should take these elementary facts into account.  As it currently stands,
 you advertise an ACCELERATING CACHE which is broken by default (it
 accelerates things that shouldn't be accelerated, and disobeys Pragma
 requirements).

 Sure, Varnish may have the superior architecture, but your dismissive
 reply doesn't leave me satisfied one bit.  And it certainly doesn't give
 me any confidence regarding the response I might get on your mailing list.

 However, in the spirit of showing you my configuration and aiding you in
 the task of debugging your application so it *improves*, I'm going to
 paste its relevant part, despite being almost convinced that you don't
 give a dime:


 {{{

 backend default {
         set backend.host = "127.0.0.1";
         set backend.port = "81";
 }

 backend blogsworks {
         set backend.host = "127.0.0.1";
         set backend.port = "8081";
 }


 sub vcl_recv {
         if (req.http.host ~ "^(www.)?blogsworks.com") {
                 # let blogsworks web server handle it
                 set req.backend = blogsworks;
         } else {
                 # these apply to my hosts
                 if ( req.url ~ "wp-content/(uploads|images)" ) {
                         if ( !(req.url ~ "wp-content/(uploads/|)images
 /gravatar-picture.png$") ) {
                                 if ( req.http.referer ~ "^http(|s)://" ) {
                                         if ( !(req.http.referer ~
 "^http(|s)://(([a-z-]+\.|)rudd-o\.com|([a-z]+\.|)turbochargedcms\.com|faviconsfor\.us|images\.google(.+)|([a-z-]+\.|)hi5\.com|([a-z-]+\.|)planetalinux\.([a-z-]+))"
 )) {
                                                 error 403 "Hotlinking is
 forbidden";
                                         }
                                 }
                         }
                 }
         }

 #       if (req.http.pragma ~ "no-cache" || req.http.cache-control ~ "no-
 cache") {
 #               # nocaches get the nocache treatment
 #               pipe;
 #       }

 }


 }}}


 The last four commented sentences were commented by me because they had no
 effect.

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/122#comment:4>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list