Remove Google Analytics cookies in Varnish

As part of our ongoing implementations of Varnish, it is useful to be able to selectively remove cookies in order to reduce duplicate caching of dynamic content.

A good example would be removing cookies set by Google Analytics. To do this, simply add the following to vcl_recv():

sub vcl_recv {
  if (req.http.cookie) {
    set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");
    if (req.http.cookie ~ "^ *$") {
        remove req.http.cookie;
    }
  }
}

4 Tumblr SEO Tips

Tumblr sites by default may have some issues being ranked on search results and could use additional search engine optimization to improve search results. Some sample polling of users show that default Wordpress sites tend to work better in search engine results than Tumblr sites.

Fortunately, Tumblr provides the ability to modify the html as well as custom formatting tags. The following tips should help improve a site’s ranking by providing search engines with additional information.

  1. Modify the <title> tag to reflect post title and summary:
  2. By putting the post summary first, it makes it more likely to show up on a search for the content than the blog title.

    <title>{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}</title>

  3. Modify the meta tag for title and description:
  4. <meta name=”title” content=”{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}” />
    <meta name=”description” content=”{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title} - {Description}” />

  5. Put appropriate keywords into the keywords meta tag:
  6. <meta name=”keywords” content=”{block:Permalink}{block:Posts}{block:Tags}{Tag}, {/block:Tags}{/block:Posts}{/block:Permalink}” />

  7. Submit the sitemap.xml to Google Webmaster Tools, Y! Site Explorer and Bing Webmaster:
  8. Each Tumblr site has a sitemap.xml file at http://site.tumblr.com/sitemap.xml. By submitting this, search engines will have better information about the pages to index and thus will be able to index more pages per site.

    For your convenience, the links below go to the relevant sites: