{"id":303,"date":"2013-08-23T12:32:12","date_gmt":"2013-08-23T12:32:12","guid":{"rendered":"https:\/\/gosqeng.test\/?p=303"},"modified":"2019-11-28T12:29:28","modified_gmt":"2019-11-28T12:29:28","slug":"gzip-tracking-code","status":"publish","type":"post","link":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code","title":{"rendered":"Adding gzip compression to the GoSquared Tracking Code"},"content":{"rendered":"<p><img decoding=\"async\" src=\"\/\/static.gosquared.com\/img\/gzip-cdn.png\" alt=\"gzip CDN bandwidth difference\"><\/p>\n<p>For years we&#8217;ve been serving our tracking code (the GSTC) through a global Content Delivery Network (CDN) called <a href=\"http:\/\/aws.amazon.com\/cloudfront\/\" target=\"_blank\" rel=\"noopener noreferrer\">CloudFront<\/a>.<\/p>\n<p>CloudFront replicates our GSTC across the world allowing us to deliver it in the fastest possible time to your visitors.<\/p>\n<p>Our original setup meant CloudFront was loading our code from a minified, but uncompressed file on <a href=\"http:\/\/aws.amazon.com\/s3\/\" target=\"_blank\" rel=\"noopener noreferrer\">S3<\/a>. Most modern web browsers support gzip compression to reduce bandwidth, and using the CDN pointing straight to S3 meant this couldn&#8217;t be enabled.<\/p>\n<p>The solution? Using our NginX cluster as the CDN&#8217;s origin. That way, the CDN loads the tracker from our nginx cluster, which in turn loads it from S3 and compresses it before passing it to the CDN. The CDN then caches and distributes this compressed code to its edge locations.<\/p>\n<p>The results have been much bigger than we first expected, reducing the CDN data transfer amount by 40% but also, more importantly, further improving load times for the tracker for website visitors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"\/\/static.gosquared.com\/img\/gzip-cdn.png\" alt=\"gzip CDN bandwidth difference\"><\/p>\n<p>We&#8217;ve started serving our tracking code with gzip compression enabled, causing a huge drop in bandwidth and faster delivery to your visitors.<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1452],"tags":[],"class_list":["post-303","post","type-post","status-publish","format-standard","hentry","category-engineering"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v18.6 (Yoast SEO v19.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Adding gzip compression to the GoSquared Tracking Code CDN<\/title>\n<meta name=\"description\" content=\"Adding gzip compression to your CDN is an easy way to reduce bandwidth and we&#039;ve recently been able to enable it, causing a massive drop in bandwidth.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding gzip compression to the GoSquared Tracking Code\" \/>\n<meta property=\"og:description\" content=\"Adding gzip compression to your CDN is an easy way to reduce bandwidth and we&#039;ve recently been able to enable it, causing a massive drop in bandwidth.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code\" \/>\n<meta property=\"og:site_name\" content=\"GoSquared Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GoSquared\" \/>\n<meta property=\"article:published_time\" content=\"2013-08-23T12:32:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-28T12:29:28+00:00\" \/>\n<meta property=\"og:image\" content=\"\/\/static.gosquared.com\/img\/gzip-cdn.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@simon_tabor\" \/>\n<meta name=\"twitter:site\" content=\"@GoSquared\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon Tabor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\",\"name\":\"GoSquared\",\"url\":\"https:\/\/www.gosquared.com\/blog\/\",\"sameAs\":[\"https:\/\/instagram.com\/gosquaredteam\",\"https:\/\/www.linkedin.com\/company\/go-squared-ltd.\",\"https:\/\/www.facebook.com\/GoSquared\",\"https:\/\/twitter.com\/GoSquared\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png\",\"contentUrl\":\"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png\",\"width\":1270,\"height\":250,\"caption\":\"GoSquared\"},\"image\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#website\",\"url\":\"https:\/\/www.gosquared.com\/blog\/\",\"name\":\"GoSquared Blog\",\"description\":\"Turn visitors into customers.\",\"publisher\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gosquared.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#webpage\",\"url\":\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code\",\"name\":\"Adding gzip compression to the GoSquared Tracking Code CDN\",\"isPartOf\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#website\"},\"datePublished\":\"2013-08-23T12:32:12+00:00\",\"dateModified\":\"2019-11-28T12:29:28+00:00\",\"description\":\"Adding gzip compression to your CDN is an easy way to reduce bandwidth and we've recently been able to enable it, causing a massive drop in bandwidth.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.gosquared.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adding gzip compression to the GoSquared Tracking Code\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#webpage\"},\"author\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/71fad71f60ad33cf9356687b37aed3d0\"},\"headline\":\"Adding gzip compression to the GoSquared Tracking Code\",\"datePublished\":\"2013-08-23T12:32:12+00:00\",\"dateModified\":\"2019-11-28T12:29:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#webpage\"},\"wordCount\":168,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\"},\"articleSection\":[\"Engineering\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/71fad71f60ad33cf9356687b37aed3d0\",\"name\":\"Simon Tabor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dc920e48608646bda51d2e6e2595e8ad926cff52eba534c1d25fb1618f15b59f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dc920e48608646bda51d2e6e2595e8ad926cff52eba534c1d25fb1618f15b59f?s=96&d=mm&r=g\",\"caption\":\"Simon Tabor\"},\"description\":\"Lead developer at GoSquared for integrations, partnerships and the API. Works on pretty much everything.\",\"sameAs\":[\"http:\/\/simontabor.com\",\"https:\/\/twitter.com\/simon_tabor\"],\"url\":\"https:\/\/www.gosquared.com\/blog\/author\/simontabor\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Adding gzip compression to the GoSquared Tracking Code CDN","description":"Adding gzip compression to your CDN is an easy way to reduce bandwidth and we've recently been able to enable it, causing a massive drop in bandwidth.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code","og_locale":"en_US","og_type":"article","og_title":"Adding gzip compression to the GoSquared Tracking Code","og_description":"Adding gzip compression to your CDN is an easy way to reduce bandwidth and we've recently been able to enable it, causing a massive drop in bandwidth.","og_url":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code","og_site_name":"GoSquared Blog","article_publisher":"https:\/\/www.facebook.com\/GoSquared","article_published_time":"2013-08-23T12:32:12+00:00","article_modified_time":"2019-11-28T12:29:28+00:00","og_image":[{"url":"\/\/static.gosquared.com\/img\/gzip-cdn.png"}],"twitter_card":"summary_large_image","twitter_creator":"@simon_tabor","twitter_site":"@GoSquared","twitter_misc":{"Written by":"Simon Tabor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.gosquared.com\/blog\/#organization","name":"GoSquared","url":"https:\/\/www.gosquared.com\/blog\/","sameAs":["https:\/\/instagram.com\/gosquaredteam","https:\/\/www.linkedin.com\/company\/go-squared-ltd.","https:\/\/www.facebook.com\/GoSquared","https:\/\/twitter.com\/GoSquared"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png","contentUrl":"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png","width":1270,"height":250,"caption":"GoSquared"},"image":{"@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/www.gosquared.com\/blog\/#website","url":"https:\/\/www.gosquared.com\/blog\/","name":"GoSquared Blog","description":"Turn visitors into customers.","publisher":{"@id":"https:\/\/www.gosquared.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gosquared.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#webpage","url":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code","name":"Adding gzip compression to the GoSquared Tracking Code CDN","isPartOf":{"@id":"https:\/\/www.gosquared.com\/blog\/#website"},"datePublished":"2013-08-23T12:32:12+00:00","dateModified":"2019-11-28T12:29:28+00:00","description":"Adding gzip compression to your CDN is an easy way to reduce bandwidth and we've recently been able to enable it, causing a massive drop in bandwidth.","breadcrumb":{"@id":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gosquared.com\/blog\/gzip-tracking-code"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.gosquared.com\/blog"},{"@type":"ListItem","position":2,"name":"Adding gzip compression to the GoSquared Tracking Code"}]},{"@type":"Article","@id":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#article","isPartOf":{"@id":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#webpage"},"author":{"@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/71fad71f60ad33cf9356687b37aed3d0"},"headline":"Adding gzip compression to the GoSquared Tracking Code","datePublished":"2013-08-23T12:32:12+00:00","dateModified":"2019-11-28T12:29:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#webpage"},"wordCount":168,"commentCount":0,"publisher":{"@id":"https:\/\/www.gosquared.com\/blog\/#organization"},"articleSection":["Engineering"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.gosquared.com\/blog\/gzip-tracking-code#respond"]}]},{"@type":"Person","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/71fad71f60ad33cf9356687b37aed3d0","name":"Simon Tabor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dc920e48608646bda51d2e6e2595e8ad926cff52eba534c1d25fb1618f15b59f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc920e48608646bda51d2e6e2595e8ad926cff52eba534c1d25fb1618f15b59f?s=96&d=mm&r=g","caption":"Simon Tabor"},"description":"Lead developer at GoSquared for integrations, partnerships and the API. Works on pretty much everything.","sameAs":["http:\/\/simontabor.com","https:\/\/twitter.com\/simon_tabor"],"url":"https:\/\/www.gosquared.com\/blog\/author\/simontabor"}]}},"wps_subtitle":"How we reduced data transfer by 40%","_links":{"self":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts\/303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/comments?post=303"}],"version-history":[{"count":0,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts\/303\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/media?parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/categories?post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/tags?post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}