<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi,<BR>
<BR>
Is there any way to check if a particular request was answered "in grace" by sending a HTTP header?<BR>
<BR>
I'm trying to increase the grace period if the user-agent contains "Googlebot" in order to speed up crawling response time and consequently be better positioned in Google organic search results. When I access using Googlebot in the user-agent header I'm not sure if Varnish is waiting for a backend request or not.<BR>
<BR>
VCL excerpt:<BR>
<BR>
<FONT face="Courier New">sub vcl_recv {</FONT><BR>
<FONT face="Courier New"> ...</FONT><BR>
<FONT face="Courier New"> # Set Grace<BR> if (req.http.user-agent ~ "Googlebot") {<BR> set req.grace = 12h;<BR> } else {<BR> set req.grace = 30m;<BR> }</FONT><BR>
<FONT face="Courier New"> ...</FONT><BR>
<FONT face="Courier New">}</FONT><BR>
<BR><FONT face="Courier New">sub vcl_fetch {</FONT><BR>
<FONT face="Courier New"> ...</FONT><BR>
<FONT face="Courier New"> # Set Grace<BR> set beresp.grace = 12h;</FONT><BR>
<FONT face="Courier New"> ...</FONT><BR>
<FONT face="Courier New">}</FONT><BR>
<BR>
Thanks,<BR>
Carlos Cima<BR> </body>
</html>