Partial content problem with facebook

Claudio Castro ccastro at altavoz.net
Wed Feb 23 23:10:34 CET 2011


Meanwhile we put a pipe on useragent ~ facebook, and it works.

maybe someone can find it useful:

sub vcl_recv {

if (req.http.user-agent ~ "facebookexternalhit")
        {
        return(pipe);
        }



Saludos,



Claudio Castro wrote:
> Thanks for the quick answer i gonna try to explain it in a better way.
>
> In the page im hosting exist a button to share the page on facebook, 
> this button call a facebook php: http://www.facebook.com/sharer.php? 
> with the URL of the page you want to share as a argument, then 
> facebook calls my webserver page and insert an "article" on the 
> visitor fb page, but when we try to do this trough varnish its return 
> 206 partial content, it happened before with 2.1.3 on other host and 
> it was fix editing include/http_headers.h and recompiling but for this 
> host in particular that doesn't work, neither upgrading to 2.1.5.
>
> varnishlog:
>
>
>   18 SessionOpen  c 66.220.156.248 59158 200.91.41.13:80
>   18 ReqStart     c 66.220.156.248 59158 465084232
>   18 RxRequest    c GET
>   18 RxURL        c /fi/fa/fo/fu.html
>   18 RxProtocol   c HTTP/1.1
>   18 RxHeader     c User-Agent: facebookexternalhit/1.1 
> (+http://www.facebook.com/externalhit_uatext.php)
>   18 RxHeader     c Host: www.xx.cl
>   18 RxHeader     c Accept: */*
>   18 RxHeader     c Accept-Encoding: gzip
>   18 RxHeader     c Range: bytes=0-40960
>   18 VCL_call     c recv pass
>   18 VCL_call     c hash hash
>   18 VCL_call     c pass pass
>   18 Backend      c 44 default default
>   18 TTL          c 465084232 RFC 120 1298496205 0 0 0 0
>   18 VCL_call     c fetch restart
>   18 ObjProtocol  c HTTP/1.1
>   18 ObjStatus    c 206
>   18 ObjResponse  c Partial Content
>   18 ObjHeader    c Date: Wed, 23 Feb 2011 21:23:26 GMT
>   18 ObjHeader    c Server: Apache
>   18 ObjHeader    c Vary: Accept-Encoding
>   18 ObjHeader    c Content-Encoding: gzip
>   18 ObjHeader    c Content-Range: bytes 0-13900/13901
>   18 ObjHeader    c Content-Length: 13901
>   18 ObjHeader    c Content-Type: text/html; charset=UTF-8
>   18 VCL_call     c recv pass
>   18 VCL_call     c hash hash
>   18 VCL_call     c pass pass
>   18 Backend      c 44 default default
>   18 TTL          c 465084232 RFC 120 1298496205 0 0 0 0
>   18 VCL_call     c fetch restart                        <------ This 
> restart is because i use a inexistent page to capture the log, and i
>                                                                                      
> have a restart on 404 in my vcl
>   18 ObjProtocol  c HTTP/1.1
>   18 ObjStatus    c 206
>   18 ObjResponse  c Partial Content
>   18 ObjHeader    c Date: Wed, 23 Feb 2011 21:23:26 GMT
>   18 ObjHeader    c Server: Apache
>   18 ObjHeader    c Vary: Accept-Encoding
>   18 ObjHeader    c Content-Encoding: gzip
>   18 ObjHeader    c Content-Range: bytes 0-13900/13901
>   18 ObjHeader    c Content-Length: 13901
>   18 ObjHeader    c Content-Type: text/html; charset=UTF-8
>   18 VCL_call     c recv pass
>   18 VCL_call     c hash hash
>   18 VCL_call     c pass pass
>   18 Backend      c 44 default default
>   18 TTL          c 465084232 RFC 120 1298496205 0 0 0 0
>   18 VCL_call     c fetch restart
>   18 ObjProtocol  c HTTP/1.1
>   18 ObjStatus    c 206
>   18 ObjResponse  c Partial Content
>   18 ObjHeader    c Date: Wed, 23 Feb 2011 21:23:26 GMT
>   18 ObjHeader    c Server: Apache
>   18 ObjHeader    c Vary: Accept-Encoding
>   18 ObjHeader    c Content-Encoding: gzip
>   18 ObjHeader    c Content-Range: bytes 0-13900/13901
>   18 ObjHeader    c Content-Length: 13901
>   18 ObjHeader    c Content-Type: text/html; charset=UTF-8
>   18 VCL_call     c recv pass
>   18 VCL_call     c hash hash
>   18 VCL_call     c pass pass
>   18 Backend      c 44 default default
>   18 TTL          c 465084232 RFC 120 1298496205 0 0 0 0
>   18 VCL_call     c fetch restart
>   18 ObjProtocol  c HTTP/1.1
>   18 ObjStatus    c 206
>   18 ObjResponse  c Partial Content
>   18 ObjHeader    c Date: Wed, 23 Feb 2011 21:23:26 GMT
>   18 ObjHeader    c Server: Apache
>   18 ObjHeader    c Vary: Accept-Encoding
>   18 ObjHeader    c Content-Encoding: gzip
>   18 ObjHeader    c Content-Range: bytes 0-13900/13901
>   18 ObjHeader    c Content-Length: 13901
>   18 ObjHeader    c Content-Type: text/html; charset=UTF-8
>   18 VCL_call     c recv pass
>   18 VCL_call     c error deliver
>   18 VCL_call     c deliver deliver
>   18 TxProtocol   c HTTP/1.1
>   18 TxStatus     c 206
>   18 TxResponse   c Partial Content
>   18 TxHeader     c Server: Varnish
>   18 TxHeader     c Retry-After: 0
>   18 TxHeader     c Content-Type: text/html; charset=utf-8
>   18 TxHeader     c Content-Length: 315
>   18 TxHeader     c Date: Wed, 23 Feb 2011 21:23:25 GMT
>   18 TxHeader     c X-Varnish: 465084232
>   18 TxHeader     c Age: 0
>   18 TxHeader     c Via: 1.1 varnish
>   18 TxHeader     c Connection: close
>   18 Length       c 315
>   18 ReqEnd       c 465084232 1298496205.030656099 
> 1298496205.104776859 0.000021458 0.074101925 0.000018835
>
> Stewart Robinson wrote:
>> On 23 Feb 2011, at 20:54, Claudio Castro <ccastro at altavoz.net> wrote:
>>
>>  
>>> Hi everybody,
>>>
>>> I'm having trouble integrating one of my host domains with facebook 
>>> "share" (http://www.facebook.com/sharer.php), i already fix it to 
>>> another site changing http_headers.h on 2.1.3, but it doesn't work 
>>> for this one, then i try upgrading varnish to 2.1.5 but it fails 
>>> too, it only works directly to the backend.
>>>
>>> Any advice?
>>>
>>>
>>> -- 
>>> Claudio Castro N.
>>> Jefe de Plataforma
>>> AltaVoz S.A.
>>> http://www.altavoz.net
>>> Viña del Mar:
>>> 2 Poniente 355 of 53
>>> +56 32 276 8060
>>> Santiago:
>>> Guardia Vieja 255, oficina 612
>>> +56 2 585 4264
>>>
>>>
>>> _______________________________________________
>>> varnish-misc mailing list
>>> varnish-misc at varnish-cache.org
>>> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>>     
>>
>> Hi,
>> Are you using Facebook.com as a varnish backend for some calls from
>> your application?
>>
>> If not I don't see how varnish is involved with a http request to 
>> Facebook?
>>
>> Stew
>>   
>
>


-- 
Claudio Castro N.
Jefe de Plataforma
AltaVoz S.A.
  http://www.altavoz.net
Viña del Mar:
  2 Poniente 355 of 53
  +56 32 276 8060
Santiago:
  Guardia Vieja 255, oficina 612
  +56 2 585 4264





More information about the varnish-misc mailing list