TCP_HIT header

2008-11-05 Thread Alecs Henry
Hi guys,

Is there a variable that I can print on the response header that will give
me the cache lookup result such as TCP_HIT or TCP_MISS?

Thanks!!

Alecs
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: TCP_HIT header

2008-11-05 Thread Alecs Henry
Hi Per,
Thanks for the reply!

The issue here is not how to add the header, that is OK, I can do it just
fine (even added the Foo: bar header just for the fun of it!). The problem
is WHAT variable I can use that contains that information (MISS or HIT).
Is there more documentation on the variables available than what is in
vcl(7)?
Or anywhere else for that matter.

Thanks,

Alecs

On Wed, Nov 5, 2008 at 3:10 PM, Per Buer [EMAIL PROTECTED] wrote:

 Alecs Henry skrev:
  Hi guys,
 
  Is there a variable that I can print on the response header that will
  give me the cache lookup result such as TCP_HIT or TCP_MISS?

 I guess you can add the relevant header in vcl_hit and vcl_miss

 See the FAQ:
 http://varnish.projects.linpro.no/wiki/FAQ#HowdoIaddaHTTPheader

 Just add a
 sub vcl_hit {
  # add code from faq here
 }



 --
 http://linpro.no/ | http://redpill.se/


___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: TCP_HIT header

2008-11-05 Thread Per Buer
Hi.

As I said. Add two different headers. One you add in vcl_hit and one
(preferably a different one) in vcl_miss. You need no variables. The
code in vcl_hit will be run for a hit and vcl_miss will be run for a miss.

Check out the getting started guide, the FAQ and the VCL-page on Wiki if
you seek documentation. Thats all there is, at the moment.

Per.




Alecs Henry skrev:
 Hi Per,
 Thanks for the reply!
 
 The issue here is not how to add the header, that is OK, I can do it
 just fine (even added the Foo: bar header just for the fun of it!). The
 problem is WHAT variable I can use that contains that information (MISS
 or HIT).
 Is there more documentation on the variables available than what is in
 vcl(7)?
 Or anywhere else for that matter.
 
 Thanks,
 
 Alecs
 
 On Wed, Nov 5, 2008 at 3:10 PM, Per Buer [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 
 Alecs Henry skrev:
  Hi guys,
 
  Is there a variable that I can print on the response header that will
  give me the cache lookup result such as TCP_HIT or TCP_MISS?
 
 I guess you can add the relevant header in vcl_hit and vcl_miss
 
 See the FAQ:
 http://varnish.projects.linpro.no/wiki/FAQ#HowdoIaddaHTTPheader
 
 Just add a
 sub vcl_hit {
  # add code from faq here
 }
 
 
 
 --
 http://linpro.no/ | http://redpill.se/
 
 


-- 
Per Buer - Leder Infrastruktur og Drift - Redpill Linpro
Telefon: 21 54 41 21 - Mobil: 958 39 117
http://linpro.no/ | http://redpill.se/



signature.asc
Description: OpenPGP digital signature
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: TCP_HIT header

2008-11-05 Thread Alecs Henry
Hi Per,

Here's what I got:
-
vcl.load test /usr/local/etc/varnish/configs/test.vcl
106 267
*Variable 'obj.http.X-Cache' not accessible in method 'vcl_miss'.*
At: (/usr/local/etc/varnish/configs/test.vcl Line 62 Pos 13)
set obj.http.X-Cache = TCP_MISS from  server.ip;
--
VCL compilation failed
-

It works just fine for vcl_hit though.
Any ideas?

Alecs

On Wed, Nov 5, 2008 at 3:59 PM, Per Buer [EMAIL PROTECTED] wrote:

 Hi.

 As I said. Add two different headers. One you add in vcl_hit and one
 (preferably a different one) in vcl_miss. You need no variables. The
 code in vcl_hit will be run for a hit and vcl_miss will be run for a miss.

 Check out the getting started guide, the FAQ and the VCL-page on Wiki if
 you seek documentation. Thats all there is, at the moment.

 Per.




 Alecs Henry skrev:
  Hi Per,
  Thanks for the reply!
 
  The issue here is not how to add the header, that is OK, I can do it
  just fine (even added the Foo: bar header just for the fun of it!). The
  problem is WHAT variable I can use that contains that information (MISS
  or HIT).
  Is there more documentation on the variables available than what is in
  vcl(7)?
  Or anywhere else for that matter.
 
  Thanks,
 
  Alecs
 
  On Wed, Nov 5, 2008 at 3:10 PM, Per Buer [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  Alecs Henry skrev:
   Hi guys,
  
   Is there a variable that I can print on the response header that
 will
   give me the cache lookup result such as TCP_HIT or TCP_MISS?
 
  I guess you can add the relevant header in vcl_hit and vcl_miss
 
  See the FAQ:
  http://varnish.projects.linpro.no/wiki/FAQ#HowdoIaddaHTTPheader
 
  Just add a
  sub vcl_hit {
   # add code from faq here
  }
 
 
 
  --
  http://linpro.no/ | http://redpill.se/
 
 


 --
 Per Buer - Leder Infrastruktur og Drift - Redpill Linpro
 Telefon: 21 54 41 21 - Mobil: 958 39 117
 http://linpro.no/ | http://redpill.se/


___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: TCP_HIT header

2008-11-05 Thread JT Justman
Alecs Henry wrote:
 Hi Per,
 
 Here's what I got:
 -
 vcl.load test /usr/local/etc/varnish/configs/test.vcl
 106 267
 *Variable 'obj.http.X-Cache' not accessible in method 'vcl_miss'.*
 At: (/usr/local/etc/varnish/configs/test.vcl Line 62 Pos 13)
 set obj.http.X-Cache = TCP_MISS from  server.ip;
 --
 VCL compilation failed
 -
 
 It works just fine for vcl_hit though.
 Any ideas?
 

'obj' is only available in 'hit' and 'fetch'. So set it in vcl_fetch.
The only side effect being then your header will be set in the case of a
'pass' as well, which may or may not be what you want.

-- 
[EMAIL PROTECTED]
http://www.endpoint.com
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc