How To Add Hit/Miss to Logging



  • Rogier Mulhuijzen

    Hi Steph,

    1. You can just use VCL variables in your format string. So for example:

      %h %l %u %t %r %>s %b fastly_info.state

    2. If you have changed your DNS to point everything at Fastly, yes. You should see all requests to be coming from Fastly netblocks, including passes. Passes are passed through, so there's no caching, but the clients still talk to Fastly servers, and those talk to your origins.

      This allows you to tweak the requests and responses with VCL and/or settings in the UI. And it also gives you Dynamic Site Acceleration, which works best if you designate a shield datacenter close to your origin. Because we keep connections open between our datacenters and to your origins, a lot of (TCP and TLS) round trips disappear which cuts down on the time to first byte, despite going back to origin.

      You might also want to consider adding the Fastly-Client-IP header to your IIS logs, so you can tell what the client IP was from Fastly's perspective. Alternatively, you can setup X-Forwarded-For and use that.

  • Stephanie Pfefferkorn

    Thank you for the quick reply.

    As for requests, I have a related question. When I changed the dns entries for my domain -- adding the cname for fastly -- it was not possible (I believe), to cname BOTH www and non-www versions of my domain. My application rewrites urls that come to the site without www to the www version. I'm assuming that if someone requests the url, it will go to my server first, and then subsequent requests (which will have www added to them) will go through fastly. Is there any way to make both www and non-www versions of my domain to go through fastly?

    Thanks! Steph

  • Rogier Mulhuijzen

    To avoid confusion, this question was answered in :)

Please sign in to leave a comment.