
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sun, 05 Apr 2026 13:48:31 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Q2 FY 18 Product Releases, for a better Internet “end-to-end”]]></title>
            <link>https://blog.cloudflare.com/better-internet-end-to-end/</link>
            <pubDate>Thu, 26 Jul 2018 18:35:23 GMT</pubDate>
            <description><![CDATA[ In Q2, Cloudflare released several products which enable a better Internet “end-to-end” — from the mobile client to host infrastructure. Now, anyone from an individual developer to large companies and governments, can control, secure, and accelerate their applications from “perimeter” to “host.” ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Photo by <a href="https://unsplash.com/@allenliu?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Liu Zai Hou</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></p><p>In Q2, Cloudflare released several products which enable a better Internet “end-to-end” — from the mobile client to host infrastructure. Now, anyone from an individual developer to large companies and governments, can control, secure, and accelerate their applications from the “<a href="https://www.cloudflare.com/learning/access-management/what-is-the-network-perimeter/">perimeter</a>” back to the “host.”</p><p>On the client side, <a href="https://www.cloudflare.com/products/mobile-sdk/">Cloudflare’s Mobile SDK</a> extends control directly into your mobile apps, providing visibility into application performance and load times across any global carrier network.</p><p>On the host side, <a href="https://www.cloudflare.com/products/cloudflare-workers/">Cloudflare Workers</a> lets companies move workloads from their host to the Cloudflare Network, reducing infrastructure costs and speeding up the user experience. <a href="https://www.cloudflare.com/products/argo-tunnel/">Argo Tunnel</a> lets you securely connect your host directly to a Cloudflare data center. If your host infrastructure is running other TCP services besides HTTP(S), you can now protect it with Cloudflare’s DDoS protection using <a href="https://www.cloudflare.com/products/cloudflare-spectrum/">Spectrum</a>.</p><p>So for end-to-end control that is easy and fast to deploy, these recent products are all incredible “workers” across the “spectrum” of your needs.</p>
    <div>
      <h3>But there’s more to the story</h3>
      <a href="#but-theres-more-to-the-story">
        
      </a>
    </div>
    <p>End users want richer experiences, such as more video, interactivity, and images. Meeting those needs can incur real costs in bandwidth, hardware, and time. Cloudflare addresses these with three products that improve video delivery, reduce paint times, and shrink the round-trip times.</p><p>Cloudflare now simplifies and reduces delivery cost of video with <a href="https://www.cloudflare.com/products/stream-delivery/">Stream Delivery</a>. Pages using plenty of Javascript now have faster paint times and wider mobile-device support with <a href="/we-have-lift-off-rocket-loader-ga-is-mobile/">Rocket Loader</a>. If you’re managing multiple origins and want to ensure fastest delivery based on the shortest round-trip time, Cloudflare Load Balancer now supports <a href="/i-wanna-go-fast-load-balancing-dynamic-steering/">Dynamic Steering</a>.</p><p>Attackers are shifting their focus to the application layer. Some security features, like CAPTCHA and Javascript Challenge, give you more control and reduce false-positives when blocking rate-based threats at the edge, such as layer 7 DDoS or brute-force attacks.</p><p>Finally, Cloudflare extended privacy to consumers through the launch of our DNS resolver <a href="https://1.1.1.1">1.1.1.1</a> on 4/1/2018! Now users who set their DNS resolvers to 1.1.1.1 can browse faster while protecting browser data with Cloudflare’s privacy-first consumer DNS service.</p>
    <div>
      <h3>Here is a recap from April to June of the features we released in Q2</h3>
      <a href="#here-is-a-recap-from-april-to-june-of-the-features-we-released-in-q2">
        
      </a>
    </div>
    
    <div>
      <h4>Dynamic Steering</h4>
      <a href="#dynamic-steering">
        
      </a>
    </div>
    <p><i>Tue, July 10, 2018</i>Dynamic steering is a load balancing feature that automates traffic steering across origins in multiple geographic regions. <a href="https://www.cloudflare.com/learning/cdn/glossary/round-trip-time-rtt/">Round-trip time (RTT)</a> for health checks is calculated across multiple pools of load balanced servers and origins to determine the fastest server pools. This RTT data enables the load balancers to identify the fastest pools, and to direct user requests to the most responsive origins.</p><ul><li><p><a href="/i-wanna-go-fast-load-balancing-dynamic-steering/">Blog Post</a></p></li><li><p><a href="https://www.cloudflare.com/load-balancing/">Product Page</a></p></li><li><p><a href="https://support.cloudflare.com/hc/en-us/articles/360006900952">Support Article</a></p></li></ul>
    <div>
      <h4>Support for New DNS Record Types</h4>
      <a href="#support-for-new-dns-record-types">
        
      </a>
    </div>
    <p><i>Thu, July 5, 2018</i>Cloudflare's Authoritative DNS now supports the following record types: CERT, DNSKEY, DS, NAPTR, SMIMEA, SSHFP, TLSA, and URI via the web and API.</p>
    <div>
      <h4>Developer Portal Q2 Update</h4>
      <a href="#developer-portal-q2-update">
        
      </a>
    </div>
    <p><i>Mon, June 11, 2018</i>The Developer Portal has been updated in Q2 to include improved search, documentation for new products, and listings of upcoming Cloudflare community events.</p><ul><li><p><a href="https://developers.cloudflare.com/">Developer Portal</a></p></li></ul>
    <div>
      <h4>Rocket Loader Upgrade</h4>
      <a href="#rocket-loader-upgrade">
        
      </a>
    </div>
    <p><i>Fri, June 1, 2018</i>Rocket Loader has been updated to deliver faster performance for website paint &amp; load times by prioritizing website content over JavaScript. Majority of mobile devices are now supported. Increased compliance with strict content security policies.</p><ul><li><p><a href="https://support.cloudflare.com/hc/en-us/articles/200168056-What-does-Rocket-Loader-do-">Support</a></p></li><li><p><a href="/we-have-lift-off-rocket-loader-ga-is-mobile/">Blog</a></p></li></ul>
    <div>
      <h4>Stream Delivery</h4>
      <a href="#stream-delivery">
        
      </a>
    </div>
    <p><i>Thu, May 31, 2018</i>Cloudflare’s Stream Delivery solution offers fast caching and delivery of video content across our network of 150+ global data centers.</p><ul><li><p><a href="https://www.cloudflare.com/products/stream-delivery/">Product Page</a></p></li></ul>
    <div>
      <h4>Deprecating TLS 1.0 and 1.1 on api.cloudflare.com</h4>
      <a href="#deprecating-tls-1-0-and-1-1-on-api-cloudflare-com">
        
      </a>
    </div>
    <p><i>Tue, May 29, 2018</i>On June 4, Cloudflare will be dropping support for TLS 1.0 and 1.1 on <a href="http://api.cloudflare.com/">api.cloudflare.com</a>. Additionally, the dashboard will be moved from <a href="http://www.cloudflare.com/a">www.cloudflare.com/a</a> to <a href="http://dash.cloudflare.com/">dash.cloudflare.com</a> and will require a browser that supports TLS 1.2 or higher.</p><ul><li><p><a href="https://www.cloudflare.com/ssl/">Product Page</a></p></li><li><p><a href="/deprecating-old-tls-versions-on-cloudflare-dashboard-and-api/">Blog Post</a></p></li></ul>
    <div>
      <h4>Rate Limiting has new Actions and Triggers</h4>
      <a href="#rate-limiting-has-new-actions-and-triggers">
        
      </a>
    </div>
    <p><i>Mon, May 21, 2018</i>Rate Limiting has two new features: challenges (CAPTCHA and JS Challenge) as an Action; and matching Header attributes in the response (from either origin or the cache) as the Trigger. These features give more control over how Cloudflare Rate Limiting responds to threshold violations, giving customers granularity over the types of requests to "count" to fit their different applications. To learn more, go to the blog post.</p><ul><li><p><a href="https://www.cloudflare.com/rate-limiting/">Product Page</a></p></li><li><p><a href="/rate-limiting-delivering-more-rules-and-greater-control/">Blog Post</a></p></li></ul>
    <div>
      <h4>Support purge-by-tag for large tag sizes</h4>
      <a href="#support-purge-by-tag-for-large-tag-sizes">
        
      </a>
    </div>
    <p><i>Thu, May 10, 2018</i>The Cache-Tag header now supports up to 1000 tags and a total header length of 16kb. This update simplifies file purges for customers who deploy websites with Drupal.</p><ul><li><p><a href="https://support.cloudflare.com/hc/en-us/articles/206596608-How-to-Purge-Cache-Using-Cache-Tags-Enterprise-only-">Support article</a></p></li></ul>
    <div>
      <h4>Multi-User Access on dash.cloudflare.com</h4>
      <a href="#multi-user-access-on-dash-cloudflare-com">
        
      </a>
    </div>
    <p><i>Wed, May 2, 2018</i>Starting May 2 2018, users can go to the new home of Cloudflare’s Dashboard at <a href="http://dash.cloudflare.com/">dash.cloudflare.com</a> and share account access. This has been supported at our Enterprise level of service, but is now being extended to all customers.</p><ul><li><p><a href="/expanding-multi-user-access/">Blog Post</a></p></li></ul>
    <div>
      <h4>Support full SSL (Strict) mode validation for CNAME domains</h4>
      <a href="#support-full-ssl-strict-mode-validation-for-cname-domains">
        
      </a>
    </div>
    <p><i>Thu, April 12, 2018</i>Cloudflare is now able to validate origin certificates that use a hostname's CNAME target in Full SSL (Strict) mode. Previously, Cloudflare would not validate any certificate without a direct match of the HTTP hostname and the certificate's Common Name or SAN. This update allows SSL for SaaS customers to more easily enable end-to-end security.</p><ul><li><p><a href="https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-mean-">Support</a></p></li><li><p><a href="https://www.cloudflare.com/ssl-for-saas-providers">SSL for SaaS</a></p></li></ul>
    <div>
      <h4>Cloudflare Spectrum</h4>
      <a href="#cloudflare-spectrum">
        
      </a>
    </div>
    <p><i>Thu, April 12, 2018</i>Spectrum protects TCP applications and ports from volumetric DDoS attacks and data theft by proxying non-web traffic through Cloudflare’s Anycast network.</p><ul><li><p><a href="https://www.cloudflare.com/products/cloudflare-spectrum/">Product Page</a></p></li><li><p><a href="/spectrum/">Blog Post</a></p></li></ul>
    <div>
      <h4>Workers Can Control Cache TTL by Response Code</h4>
      <a href="#workers-can-control-cache-ttl-by-response-code">
        
      </a>
    </div>
    <p><i>Wed, April 11, 2018</i>Cloudflare workers can now control cache TTL by response code. This provides greater control over cached assets with Cloudflare Workers.</p><ul><li><p><a href="https://developers.cloudflare.com/workers/reference/cloudflare-features/">Documentation</a></p></li></ul>
    <div>
      <h4>Argo Tunnel</h4>
      <a href="#argo-tunnel">
        
      </a>
    </div>
    <p><i>Thu, April 5, 2018</i>Argo Tunnel ensures that no visitor or attacker can reach your web server unless they first pass through Cloudflare. Using a lightweight agent installed on your origin, Cloudflare creates an encrypted tunnel between your host infrastructure and our nearest data centers without opening a public inbound port. It’s more secure, more performant, and easier to manage than exposing your services publically.</p><ul><li><p><a href="https://developers.cloudflare.com/argo-tunnel/quickstart/">Developer Doc</a></p></li><li><p><a href="https://www.cloudflare.com/products/argo-tunnel/">Read More</a></p></li></ul> ]]></content:encoded>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Mobile SDK]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Load Balancing]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Spectrum]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Cloudflare Tunnel]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">30mcTficRd4F27mbRddmAS</guid>
            <dc:creator>Timothy Fong</dc:creator>
        </item>
        <item>
            <title><![CDATA[Too Old To Rocket Load, Too Young To Die]]></title>
            <link>https://blog.cloudflare.com/too-old-to-rocket-load-too-young-to-die/</link>
            <pubDate>Wed, 04 Jul 2018 14:58:21 GMT</pubDate>
            <description><![CDATA[ Rocket Loader is in the news again. One of Cloudflare's earliest web performance products has been re-engineered for contemporary browsers and Web standards.

It controls the load and execution of your JavaScript, ensuring useful, meaningful page content is unblocked and displayed sooner. ]]></description>
            <content:encoded><![CDATA[ <p>Rocket Loader is in the news again. One of Cloudflare's earliest web performance products has been re-engineered for contemporary browsers and Web standards.</p><p>No longer a beta product, Rocket Loader controls the load and execution of your page JavaScript, ensuring useful and meaningful page content is unblocked and displayed sooner.</p><p>For a high-level discussion of Rocket Loader aims, please refer to our sister post, <a href="/we-have-lift-off-rocket-loader-ga-is-mobile/">We have lift off - Rocket Loader GA is mobile!</a></p><p>Below, we offer a lower-level outline of how Rocket Loader actually achieves its goals.</p>
    <div>
      <h3>Prehistory</h3>
      <a href="#prehistory">
        
      </a>
    </div>
    <p>Early humans looked upon Netscape 2.0, with its new ability to script HTML using LiveScript, and <code>&lt;BLINK&gt;</code>ed to ensure themselves they weren’t dreaming. They decided to use this technology, soon to be re-christened JavaScript (a story told often and elsewhere), for everything they didn’t know they needed: form input validation, image substitution, frameset manipulation, popup windows, and more. The sole requirement was a few interpreted commands enclosed in a <code>&lt;script&gt;</code> tag. The possibilities were endless.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3koyiGY3ofb0n0pf4qzuIn/abff6cdaf842ca710c41d560f4396328/prehistory-_4x.png" />
            
            </figure><p>Soon, the introduction of the <code>src</code> attribute allowed them to import a file full of JS into their pages. Little need to fiddle with the markup, when all the requisite JS for the page could be included in a single, or a few, external files, specified in the page’s <code>&lt;HEAD&gt;</code>. It didn’t take our ancestors long before they decided that the same JS file(s) should be in <i>all</i> pages, throughout their website, containing JS for the complete site. No worries about bloat; after all, the browser would cache it.</p><p>A clear, sunny, road to dynamic, interactive sites lay ahead. What could go wrong?</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3kYBa0v72xkrGHmbZlVApH/de4fe237c97739dc8b8359b4ec122ff1/blockage_4x.png" />
            
            </figure>
    <div>
      <h3>Blockage</h3>
      <a href="#blockage">
        
      </a>
    </div>
    <p>Those early JS adopters deduced that when the HTML parser encountered an external script, it suspended visual rendering of the page while it went off to retrieve and execute it. Simple. The more numerous and larger the scripts, the longer the wait for the page to paint. JavaScript, therefore, was very soon, most often unnecessarily, blocking page rendering.</p><p>The solutions poured in, both from the developer community and browser vendors:</p><ul><li><p><i>Community</i>: Move script location to end of HTML pageA classic <i>duh!</i> moment. Amazingly, this simple suggestion helped, unless the script was required to help build the page, eg. using <code>document.write</code> for markup.</p></li><li><p><i>Vendor</i>: Use <code>&lt;script defer&gt;</code>.It’s 1997, and IE4 introduces the <code>defer</code> attribute. Scripts that do not contribute to the initial rendering of the page should be marked with <code>defer</code>, and they will load in parallel, without blocking, and be executed in their markup order before <code>window.load</code> is fired (later, before <code>document.DOMContentLoaded</code>). Script tags could remain in the <code>&lt;head&gt;</code>, and execute as if they were at the end of page.The main benefit to page rendering was the saving in script retrieval time.</p></li><li><p><i>Community</i>: Reduce latency by reducing actual script size.What began as script <i>obfuscation</i> for intellectual property and vanity reasons, quickly became script <a href="https://en.wikipedia.org/wiki/Minification_(programming)"><i>minification</i></a>, still used widely.</p></li><li><p><i>Community</i>: Reduce latency and http handshake instances through concatenation of all scripts, delivered as one.</p></li><li><p><i>Vendor</i>: Use <code>&lt;script async&gt;</code>.In 2010, 13 years (yes, 13, thirteen) after <code>defer</code> was born, HTML5 provided <code>defer</code> with a sibling, <code>async</code>. Scripts can be loaded asynchronously, be non-blocking, and be executed when they load. Markup order is irrelevant to execution order. A clear benefit over <code>defer</code> was that <code>load/DOMContentLoaded</code> events were not delayed.</p></li><li><p><i>Community</i>: Lazy Loading.Use JS to load JS by dynamically creating non-blocking script tags.</p></li><li><p><i>Cloudflare</i>: Rocket LoaderIt's 2011, and Cloudflare enters the fray, leveraging our network to reduce http requests for 1st party scripts, “bag”ging 3rd party scripts into a single file, and delaying and controlling JS execution.See <a href="/we-have-lift-off-rocket-loader-ga-is-mobile/">Combining Javascript &amp; CSS, a Better Way</a></p></li><li><p><i>Vendor</i>: Use <code>&lt;link rel="preload"&gt;</code> in the <code>&lt;head&gt;</code>.Important resources like scripts, in our case, can be specified for <i>preload</i>. The browser will load scripts in parallel and not block render-parsing.</p></li></ul>
    <div>
      <h3>Rocket Loader, The Early Years</h3>
      <a href="#rocket-loader-the-early-years">
        
      </a>
    </div>
    <p>Much has been written in this blog space about <a href="/tag/rocketloader/">Rocket Loader</a>, from its <a href="/how-cloudflare-rocket-loader-redefines-the-modern-cdn/">initial launch</a>, to the <a href="/we-have-lift-off-rocket-loader-ga-is-mobile/">current one</a>.</p><p>If reading outdated blog posts is not your thing, perhaps watching an extremely short video of a high-profile early Rocket Loader success (June 9, 2011) is:<a href="https://vimeo.com/24900882">CloudFlare Rocket Loader makes the Financial Times website (FT.com) faster</a></p><p>Rocket Loader improved page load times by:</p><ol><li><p>Minimising network requests through the bundling of JS files, including third-party, speeding up page rendering</p></li><li><p>Asynchronously loading the bundles, avoiding HTML parsing blockage</p></li><li><p>Caching scripts locally (using LocalStorage), reducing refetch requests.</p></li></ol><p>As browsers matured, Rocket Loader fell behind, leading to several severe shortcomings:</p><ul><li><p>It did not honour Content-Security-Policy.Rocket Loader was unaware of CSP headers, and loaded scripts indiscriminately.</p></li><li><p>It did not honour Subresource IntegrityRocket Loader loaded scripts through XHR, so browsers could not validate the fetched script.</p></li><li><p>It allowed for <a href="https://www.cloudflare.com/learning/security/threats/cross-site-scripting/">XSS</a> PersistenceSince Rocket Loader stored scripts in LocalStorage, a site’s compromised script could exist as a trojan in a customer’s storage, loading whenever the customer visited the site.</p></li><li><p>It was just out-of-date</p><ul><li><p>Script bundling fell out of favour with the introduction of http2.</p></li><li><p>The use of <code>eval()</code> was finally recognised as <i>evil</i>.</p></li><li><p>Mobile use skyrocketed; mobile browsers became sophisticated; eventually Rocket Loader was unable to support mobile.</p></li></ul></li></ul>
    <div>
      <h3>New and Improved Rocket Loader</h3>
      <a href="#new-and-improved-rocket-loader">
        
      </a>
    </div>
    <p>We recently rebuilt Rocket Loader from the ground up.</p><p>Although our aim remains the same, to improve customer page performance, we incorporated lessons learned. Most importantly, we learned not to aim too high. In order to satisfy all permutations of page layout, the old Rocket Loader created a virtual DOM, a decision that ultimately led to fragility. We've gone the simple, elegant route, knowing full well that there will be a minority of websites that will not benefit.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/515Gnp9rXBxLS4eicMWX5A/49004b2f6d659dff5b9bf10fba657629/new-and-improved-_4x.png" />
            
            </figure><p>The main concept behind Rocket Loader is quite straightforward: execute blocking scripts after all other page assets have loaded.</p><p>The scripts need to be loaded and executed in the originally intended order. Only external blocking scripts curtail page resources, but any script may rely on another one. We must simulate the <i>loading process of scripts</i>, mimicing how the browser would handle them during page load, but do it <i>after the page is actually fully loaded</i>.</p>
    <div>
      <h3>On the Server</h3>
      <a href="#on-the-server">
        
      </a>
    </div>
    <p>Rocket Loader has both a server-side and a client-side component. The goal of the former is to</p><ol><li><p>rewrite <code>&lt;script&gt;</code> tags in the page markup to make them non-executable, and</p></li><li><p>insert the client-side component of Rocket Loader into the page.</p></li></ol><p>The server-side component is built on top of our CF-HTML pipeline. CF-HTML is an nginx module that provides streaming HTML parsing and rewriting functionality with a SAX-style (<a href="https://en.wikipedia.org/wiki/Simple_API_for_XML">Simple API for XML</a>) API on top of it.</p><p>To make the scripts non-executable, we simply prepend their <code>type</code> attribute value with a randomly generated value (<a href="https://en.wikipedia.org/wiki/Cryptographic_nonce">nonce</a>), unique for each page request. Having a unique prefix for each page prevents Rocket Loader from being used as an XSS gadget to bypass various XSS filters.</p><p>Markup that looked like this:</p>
            <pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;script src="example.org/1.js"&gt;&lt;/script&gt;
    &lt;script src="example.org/2.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    ...body markup... 
    &lt;script src="example.org/3.js" type="text/javascript"&gt;&lt;/script&gt;
    ...more body markup... 
  &lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p>becomes:</p>
            <pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;script src="example.org/1.js" type="42deadbeef-"&gt;&lt;/script&gt;
    &lt;script src="example.org/2.js" type="42deadbeef-text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    ...body markup... 
    &lt;script src="example.org/3.js" type="42deadbeef-text/javascript"&gt;&lt;/script&gt;
    ...more body markup... 
    &lt;script src="https://ajax.cloudflare.com/rocket-loader.js"
            data-cf-nonce="42deadbeef" defer&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p>So far, no rocket science, but by making most, or all, scripts non-executable, Rocket Loader has unblocked page-parsing. Browsers display content sooner, improving perceived page load metrics, and engaging the user.</p>
    <div>
      <h4>On The Client</h4>
      <a href="#on-the-client">
        
      </a>
    </div>
    <p>Generally, scripts can be divided into four categories, each having distinct load and execution behaviours when inserted into the DOM:</p><ol><li><p><i>Inline scripts</i> - executed immediately upon insertion.</p></li><li><p><i>External blocking scripts</i> - start loading upon insertion, preventing other scripts from loading and executing.</p></li><li><p><i>External</i> <code>defer</code> <i>scripts</i> - start loading upon insertion, without preventing other scripts from loading and executing. Execution should happen right before <code>DOMContentLoaded</code> event.</p></li><li><p><i>External </i><code><i>async</i></code><i> scripts</i> - start loading upon insertion, without preventing other scripts from loading and executing. Executed when loaded.</p></li></ol>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4jwj7cYA0lu9sgSsf9boRx/86993ee16e0cd1eda9a3178017961b53/loadExecute1.png" />
            
            </figure><p>Modified diagram from <a href="https://html.spec.whatwg.org/#attr-script-defer">HTML Standard</a></p><p>To handle load and execution of all script types, Rocket Loader needs two passes.</p>
    <div>
      <h4>Pass One</h4>
      <a href="#pass-one">
        
      </a>
    </div>
    <p>On the first pass, we collect all scripts with our nonce onto a stack, then re-insert them into the DOM, with nonce removed, and wrapped in a comment node. These serve as our placeholders.</p>
            <pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;!--&lt;script src="example.org/1.js"&gt;&lt;/script&gt;--&gt; 
    &lt;!--&lt;script src="example.org/2.js" type="text/javascript"&gt;&lt;/script&gt;--&gt;
  &lt;/head&gt;
  &lt;body&gt;
    ...body markup...
    &lt;!--&lt;script src="example.org/3.js" type="text/javascript"&gt;&lt;/script&gt;--&gt;
    ...more body markup... 
    &lt;script src="https://ajax.cloudflare.com/rocket-loader.js"
            data-cf-nonce="42deadbeef" defer&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p>Rocket Loader now iterates through the scripts in our stack and re-inserts them, maintaining their intended position in relevant DOM collections (<code>document.scripts</code>, <code>document.querySelectorAll("script")</code>, <code>document.getElementsByTagName("script")</code>, etc.).</p><p>This process of script insertion and execution differs for each script category:</p><p><i>Inline scripts</i> - Placeholder is replaced with the original script element, without nonce, making the script executable. Browsers execute such scripts immediately upon insertion, <i>in the same execution tick</i>.</p><p><i>External blocking scripts</i> - As above, but Rocket Loader waits for the script’s <code>load</code> event before unwinding the script stack further. This delay simulates the script's blocking behaviour <b><i>manually</i></b>. Only parser-inserted external scripts (i.e. scripts present in the original HTML markup) are naturally blocking. External scripts inserted or created via a DOM API are considered async. This behaviour can’t be overridden, so we need our simulation.</p><p><i>External </i><code><i>async</i></code><i> scripts</i> - The same insertion procedure as inline scripts. Browsers treat all inserted external scripts as async, so the default behaviour suits us.</p><p><i>External </i><code><i>defer</i></code><i> scripts</i> - These are not executed during the first pass, since in the simulated environment we haven’t reached the <code>DOMContentLoaded</code> event yet. If we encounter a <code>defer</code> script on the stack we re-insert it, as is, without removing the nonce prefix. It remains non-executable, but in the correct DOM position.</p>
    <div>
      <h4>Pass Two</h4>
      <a href="#pass-two">
        
      </a>
    </div>
    <p>The second pass loads the <code>defer</code> scripts. Again, Rocket Loader collects all scripts with the nonce prefix (these are now just <code>defer</code> scripts) onto the execution stack, but does not replace them with placeholders. They remain in the DOM, since at this point in our simulated environment the complete document has loaded. We then activate them by replacing the <code>&lt;script&gt;</code> elements with themselves, nonce removed, and let the browser do the rest.</p>
    <div>
      <h4>Quirks I: Taming the Waterfall</h4>
      <a href="#quirks-i-taming-the-waterfall">
        
      </a>
    </div>
    <p>Ostensibly, we have now simulated browser script loading and execution behaviours. However, there are some one-off issues we must deal with, quirks if you will.</p><p>There is one not-so-obvious difference between our algorithm and the real behaviour of browsers. Modern browsers try to be clever with the way they manage page resources, engaging various heuristics to improve performance during page load. These are, generally, implementation-specific and not set-in-stone by any specification.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1UoWRV4FFktlhVFLGetJeC/093faf054eb7ba695d3f1ef05a184d3a/noRocketCroppedSm.png" />
            
            </figure><p>One such optimisation that affects us, is <i>speculative parsing</i>. Despite the official specification requiring a browser to block parsing on script execution, browsers continue parsing received HTML markup speculatively, and prefetch found external resources. For example, even with blocking scripts on a page, Chrome loads them simultaneously, in parallel.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1uUQ3PUV8f5FCh9SCY2Y6V/370f69793a57e917b9765e28a7a99406/prevRocketCroppedSm-1.png" />
            
            </figure><p>With Rocket Loader, browsers don’t prefetch scripts, as our nonce makes them non-executable during page load. Later, when we sequentially re-insert activated scripts, we witness a sequential “waterfall” graph.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1tjsG9hdMmd8QDZduzsrXF/bfbd69cda8f237c8eed1826a1196b58f/withRocketCroppedSm.png" />
            
            </figure><p>In our attempt to improve page load performance, we significantly slowed down some script loading. Ironic. Fortunately, we have a workaround: we can insert <i>preload hints</i> (see <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content">Preloading content with rel="preload"</a>) before we begin unwinding our script stack, giving the browser notice that we’ll soon be requiring these scripts. It begins fetching them as it would do during speculative parsing.</p><p>Our waterfall is replaced with improved parallel loading and better load metrics.</p>
    <div>
      <h4>Quirks II: <code>document.write()</code> is not dead yet</h4>
      <a href="#quirks-ii-document-write-is-not-dead-yet">
        
      </a>
    </div>
    <p>We've simulated script execution and insertion. We still need to deal with dynamic markup insertion. We can’t use <code>document.write()</code> directly since the document is already parsed and <code>document.close()</code> has been implicitely executed. Calling <code>write()</code> will create a new document, erasing the entire current document. We must manually parse content created by the <code>document.write</code> function and insert it in the intended location.</p><p>Not so simple, if one considers that <code>document.write</code> can insert partial markup. In the following example, if we parse and insert content on the first <code>document.write</code> call, we’ll completely ignore the completion of the <code>id</code> attribute that should be inserted with the second call:</p>
            <pre><code>document.write('&lt;div id="elm');
document.write(Date.now());
document.write('"&gt;some content&lt;/div&gt;');</code></pre>
            <p>So, we have a hard choice:</p><ul><li><p>We can buffer <i>all</i> content inserted via <code>document.write</code> during script execution and flush it afterwards, in which case already executed code expecting elements to be in the DOM will fail, or</p></li><li><p>We can flush inserted markup immediately, but not handle partial markup writes.</p></li></ul><p>Choosing the lesser of two evils, we decided to go with the first option: our observations showed cases like these are more common.</p><p>(Actually, there is a third option that allows for handling of both cases, but it requires proxying of a significant number of DOM APIs, a rabbit hole that we don’t want to dive into, KISS FTW, you know…).</p>
    <div>
      <h4>Quirks III: I ain't got no<code>&lt;body&gt;</code></h4>
      <a href="#quirks-iii-i-aint-got-no-body">
        
      </a>
    </div>
    <p>As mentioned, it’s not enough to just insert parsed markup. There are various modifications of the DOM performed by the parser during full document parsing that contend with <i>malformed markup</i>. We felt we should simulate at least some of them, because, well… scripts may rely on malformed markup.</p><p>Our initial implementation even included simulation of relatively exotic mechanisms such as <a href="https://html.spec.whatwg.org/multipage/parsing.html#unexpected-markup-in-tables"><i>foster parenting</i></a>, but eventually we decided to keep things simple and the only thing that Rocket Loader simulates is the squeezing out of unallowed content from the <code>&lt;head&gt;</code> element.</p><p>To perform this simulation we wrap our <code>document.write</code> buffer in a <code>&lt;head&gt;</code> element and feed this markup to the <a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMParser">DOM Parser</a>.</p><p>Using the resulting document from the parser, we identify all nodes in its <code>&lt;head&gt;</code> and move them into the page, immediately following the script that performed the <code>document.write</code>. If we encounter any nodes in the parsed document's <code>&lt;body&gt;</code> element, we copy all nodes that follow the current script to the <code>&lt;body&gt;</code> element, prepended with the nodes in the parsed document.</p><p>To illustrate this simulation, consider the following page markup:</p>
            <pre><code>&lt;!DOCTYPE&gt;
&lt;head&gt;
  &lt;script&gt;
    document.write(‘&lt;link rel=”stylesheet” href=”1.css”&gt;’);
    document.write(‘&lt;div&gt;&lt;/div&gt;’);
    document.write(‘&lt;link rel=”stylesheet” href=”2.css”&gt;’);
  &lt;/script&gt;
  &lt;link rel=”stylesheet” href=”3.css”&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div&gt;Hey!&lt;/div&gt;
&lt;/body&gt;</code></pre>
            <p>The buffered, dynamically inserted, markup after script execution will be</p>
            <pre><code>&lt;link rel=”stylesheet” href=”1.css”&gt;
&lt;div&gt;&lt;/div&gt;
&lt;link rel=”stylesheet” href=”2.css”&gt;</code></pre>
            <p>and the string that we’ll feed to the DOMParser will be</p>
            <pre><code>&lt;!DOCTYPE&gt;
&lt;head&gt;
  &lt;link rel=”stylesheet” href=”1.css”&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;link rel=”stylesheet” href=”2.css”&gt;
&lt;/head&gt;</code></pre>
            <p>The parser will produce the following document structure from the provided markup (note that <code>&lt;div&gt;</code> is not allowed in <code>&lt;head&gt;</code> and was squeezed out to the <code>&lt;body&gt;</code>):</p>
            <pre><code>&lt;!DOCTYPE&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;link rel=”stylesheet” href=”1.css”&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;link rel=”stylesheet” href=”2.css”&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p>Now we move all nodes that we found in parsed document's <code>&lt;head&gt;</code> to the original document:</p>
            <pre><code>&lt;!DOCTYPE&gt;
&lt;head&gt;
  &lt;script&gt;
    document.write(‘&lt;link rel=”stylesheet” href=”1.css”&gt;’);
    document.write(‘&lt;div&gt;&lt;/div&gt;’);
    document.write(‘&lt;link rel=”stylesheet” href=”2.css”&gt;’);
  &lt;/script&gt;
  &lt;link rel=”stylesheet” href=”1.css”&gt;
  &lt;link rel=”stylesheet” href=”3.css”&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div&gt;Hey!&lt;/div&gt;
&lt;/body&gt;</code></pre>
            <p>We see that parsed document's <code>&lt;body&gt;</code> contains some nodes, so we prepend them to the original document’s <code>&lt;body&gt;</code>:</p>
            <pre><code>&lt;!DOCTYPE&gt;
&lt;head&gt;
  &lt;script&gt;
    document.write(‘&lt;link rel=”stylesheet” href=”1.css”&gt;’);
    document.write(‘&lt;div&gt;&lt;/div&gt;’);
    document.write(‘&lt;link rel=”stylesheet” href=”2.css”&gt;’);
  &lt;/script&gt;
  &lt;link rel=”stylesheet” href=”1.css”&gt;
  &lt;link rel=”stylesheet” href=”3.css”&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;link rel=”stylesheet” href=”2.css”&gt;
  &lt;div&gt;Hey!&lt;/div&gt;
&lt;/body&gt;</code></pre>
            <p>And as a final step, we move all nodes in the <code>&lt;head&gt;</code>, that initially followed the current script, to after the nodes that we’ve just inserted in the <code>&lt;body&gt;</code>:</p>
            <pre><code>&lt;!DOCTYPE&gt;
&lt;head&gt;
  &lt;script&gt;
    document.write(‘&lt;link rel=”stylesheet” href=”1.css”&gt;’);
    document.write(‘&lt;div&gt;&lt;/div&gt;’);
    document.write(‘&lt;link rel=”stylesheet” href=”2.css”&gt;’);
  &lt;/script&gt;
  &lt;link rel=”stylesheet” href=”1.css”&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;link rel=”stylesheet” href=”2.css”&gt;
  &lt;link rel=”stylesheet” href=”3.css”&gt;
  &lt;div&gt;Hey!&lt;/div&gt;
&lt;/body&gt;</code></pre>
            
    <div>
      <h4>Quirks IV: Handling handlers</h4>
      <a href="#quirks-iv-handling-handlers">
        
      </a>
    </div>
    <p>There is one edge case which drastically changes the behaviour of our script-loading simulation. If we encounter elements with inline event handlers in the HTML markup, we need to execute <i>all scripts that precede such elements</i> since the handlers may rely on them.</p><p>We insert the Rocket Loader client side script in special "bailout" mode immediately before such elements. In bailout mode, we activate scripts the same way as in regular mode, except we do it in a blocking manner (remember, we need to prevent element from being parsed while we activate all preceding scripts).</p><p>As noted, it’s impossible to dynamically create blocking external scripts using DOM APIs such as <code>document.appendChild</code>. However, we have a solution to overcome this limitation.</p><p>Since the page is still loading, we can <code>document.write</code> the <code>outerHTML</code> of activatable script into the document, forcing the browser to mark it as parser-inserted and, thus, blocking. However, the script will be inserted in a DOM position different from its original, intended, position, which may break traversing of surrounding nodes from within the script (e.g. using <code>document.currentScript</code> as a starting point).</p><p>There is a trick. We leverage browser behaviour which parses generated content in the same execution tick as the <code>document.write</code> that produced it. We have immediate access to the written element. The <i>execution</i> of the external script is always scheduled for one of the <i>next</i> execution ticks. So, we can just move script to its original position right after we write it and have it in the correct DOM position, awaiting its execution.</p>
    <div>
      <h4>"I can resist everything except temptation"<a href="#fn1">[1]</a></h4>
      <a href="#i-can-resist-everything-except-temptation">
        
      </a>
    </div>
    <p>The need to account for every quirk, every variation in browser parsing, is strong, but implementation would eventually only weaken our product. We've dealt with the best part of browser parser behaviours, enough to benefit the majority of our customers.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5vV1rYeaoGyrndNCqb0qyq/733478aacd708279692d6dc75d4d085b/rock-house-_4x.png" />
            
            </figure>
    <div>
      <h3>What's Next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>As Rocket Loader matures, and inevitably is affected by changes in Web technologies, it may be expanded and improved. For now, we're monitoring its use, identifying issues, and ensuring that it's worthy of its predecessor, which lasted through so many advances and changes in Web technology.</p><hr /><ol><li><p>Oscar Wilde, Lady Windermere's Fan (1892), and apologies to <a href="http://jethrotull.com/too-old/">Jethro Tull</a> for the blog post title. <a href="#fnref1">↩︎</a></p></li></ol> ]]></content:encoded>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Optimization]]></category>
            <guid isPermaLink="false">6cHm33ksyTK14oTt1047Nr</guid>
            <dc:creator>Peter Belesis</dc:creator>
            <dc:creator>Ivan Nikulin</dc:creator>
        </item>
        <item>
            <title><![CDATA[We have lift off - Rocket Loader GA is mobile!]]></title>
            <link>https://blog.cloudflare.com/we-have-lift-off-rocket-loader-ga-is-mobile/</link>
            <pubDate>Fri, 01 Jun 2018 16:31:00 GMT</pubDate>
            <description><![CDATA[ Today we’re excited to announce the official GA of Rocket Loader, our JavaScript optimisation feature that will prioritise getting your content in front of your visitors faster than ever before with improved Mobile device support.  ]]></description>
            <content:encoded><![CDATA[ <p>Today we’re excited to announce the official GA of Rocket Loader, our JavaScript optimisation feature that will prioritise getting your content in front of your visitors faster than ever before with improved Mobile device support. In tests on <a href="http://www.cloudflare.com">www.cloudflare.com</a> we saw reduction of 45% (almost 1 second) in First Contentful Paint times on our pages for visitors.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/25aMZaHJf0XUvF13Sao55h/704e6dd9f7ae3502d77dbedb1f9e2ae5/photo-1457364887197-9150188c107b" />
            
            </figure><p>Photo by <a href="https://unsplash.com/@spacex?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">SpaceX</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></p><p>We initially launched Rocket Loader as a beta in June 2011, to asynchronously load a website’s JavaScript to dramatically improve the page load time. Since then, hundreds of thousands of our customers have benefited from a one-click option to boost the speed of your content.</p><p>With this release, we’ve vastly improved and streamlined Rocket Loader so that it works in conjunction with mobile &amp; desktop browsers to prioritise what matters most when loading a webpage: your content.</p>
    <div>
      <h3>Visitors don’t wait for page “load”</h3>
      <a href="#visitors-dont-wait-for-page-load">
        
      </a>
    </div>
    <p>To put it very simplistically - load time is a measure of when the browser has finished loading the document (HTML) and all assets referenced by that document.</p><p>When you clicked to visit this blog post, did you wait for the spinning wheel on your browser tab to start reading this content? You probably didn’t, and neither do your visitors. We’re conditioned to start consuming content as soon as it appears. However the industry had been focused on the load event timing too much, ignoring user perception &amp; behaviour. Data from Google analytics has shown that 53% of visits are abandoned if a mobile site takes longer than 3 seconds to load. This makes sense if you think about the last time you browsed onto a website in a hurry - if nothing is rendered quickly on screen you’re much more likely to go elsewhere.</p><p>Paint timing metrics are a closer approximation of how your users perceive speed. Put simply, paint timing measures when something is displayed on screen, and there are various stages of paint that can be measured &amp; reported which we’ll explain as we go.</p>
    <div>
      <h3>Analysing your performance</h3>
      <a href="#analysing-your-performance">
        
      </a>
    </div>
    <p>One of the ways in which you can learn more about your website’s performance is to use one of the many great synthetic analysis tools out there. The <a href="https://developers.google.com/web/tools/lighthouse/">Lighthouse</a> tool in Chrome can run a performance audit on your page simulating a typical mobile device &amp; connection. I ran this on Cloudflare’s homepage to illustrate the way the page loads over time:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/48XQjYN7Z7oEu95mvSXfYM/10aa074fb1393452f26e120460cc6d6b/Lighthouse-performance-filmstrip-without-Rocket-Loader.png" />
            
            </figure><p>The First Meaningful Paint (FMP) takes 4.8 seconds on this mobile device simulation. FMP doesn’t measure the time of the first paint, but it waits for any web fonts to render and for the biggest above-the-fold layout change to happen. The red line drawn at 4.8 seconds shows our FMP in this test. So what can we do to improve?</p>
    <div>
      <h3>Render blocking scripts are a problem for paint times</h3>
      <a href="#render-blocking-scripts-are-a-problem-for-paint-times">
        
      </a>
    </div>
    <p>Most tools will give you suggestions, and Lighthouse calls these opportunities and orders these by their estimated time saving:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/79GA4jBO0JSKSVstyCGs6y/2c97d235cbc1482beb916dcc875beb2b/Lighthouse-performance-opportunities-without-Rocket-Loader.png" />
            
            </figure><p>Try running a lighthouse audit on your website and see what opportunities you get.</p>
    <div>
      <h4>The march of the scripts</h4>
      <a href="#the-march-of-the-scripts">
        
      </a>
    </div>
    <p>Now is a good time to quantify the spread of JavaScript on the web. Using the excellent <a href="https://httparchive.org">HTTP Archive</a> project we can review the make up of the Alexa top 500k websites over the years. Using <a href="https://httparchive.org/reports/state-of-javascript?start=2011_06_01&amp;end=2018_05_01">their data</a>, we can see that the median number of JavaScripts on mobile has increased from 5, at Rocket Loader’s launch in June 2011, increasing nearly four fold to a whopping 19 JavaScripts in May 2018. So most of us have plenty of JavaScript on our websites and there’s a good chance it will be very high on the list of performance opportunities you can seize to improve your visitors’ experience.</p><p>Implementing this recommendation would require you to make changes to your origin application’s code to asynchronously load, defer or inline your scripts. In some cases this might not be possible because you don’t control your application’s code or have the expertise to implement these strategies. Rocket Loader to the rescue!</p>
    <div>
      <h3>How Rocket Loader works</h3>
      <a href="#how-rocket-loader-works">
        
      </a>
    </div>
    <p>Without Rocket Loader</p><p>With Rocket Loader</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/73cenr7paH30Yn2VWxALxW/49b4759f66a080b839a9a4b976cc97df/Rocket-before.svg" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6TVRmx5nlCPzaPampT8xDJ/7d60135dd5e75ca49673fe8d14b7fc70/Rocket-after.svg" />
            
            </figure><p>New Rocket Loader prioritises paint time by locating the JavaScripts inside your HTML page and hiding them from the browser temporarily during the page load. This allows the browser to continue parsing the rest of your HTML and begin discovering other assets such as CSS &amp; images that are required to render your page. Once that has completed, Rocket Loader dynamically inserts the scripts back into the page and so the browser can load these.</p>
    <div>
      <h4>Enabling Rocket Loader</h4>
      <a href="#enabling-rocket-loader">
        
      </a>
    </div>
    <p>This bit is quite labour-intensive, so watch closely:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5cElUV4Id3F8ybKjRpaGxS/81d040e078fadebb4ccb7d0718438600/Enabling-Rocket-Loader-animation.gif" />
            
            </figure>
    <div>
      <h3>Measuring the impact</h3>
      <a href="#measuring-the-impact">
        
      </a>
    </div>
    <p>Let’s run lighthouse again on our homepage now we have Rocket Loader enabled:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1LWqQJ9m4mSVMHm0n5YYQh/bac12594f3ee8a6a24a607dc1669ca3e/Lighthouse-performance-fimstrip-with-Rocket-Loader.png" />
            
            </figure><p>So Lighthouse has detected that First Meaningful Paint is just over 1.5 seconds faster in this test - a really impressive improvement delivered from a single click!</p><p>To drive this home, the opportunity lighthouse identified is now officially a “passed audit”:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/48gHKjbXHuGJ4m2pn1yOBx/85ebab62116894cf848d044d1999344f/Lighthouse-performance-audit-with-Rocket-Loader.png" />
            
            </figure>
    <div>
      <h4>Let’s get Real (User Measurement)</h4>
      <a href="#lets-get-real-user-measurement">
        
      </a>
    </div>
    <p>To measure this with real users &amp; devices, last week we ran a simple A/B test on <a href="http://www.cloudflare.com">www.cloudflare.com</a> where 50% of page views were optimised using Rocket Loader so we could compare performance with and without it enabled. As shown by the lighthouse audits above, our main website is a great use-case for Rocket Loader because while we do use a lot of JavaScript for some interactive aspects of our pages, most important to our visitors is reading information about Cloudflare’s network, products &amp; features. So in short, content should be prioritised over JavaScript.</p><p>To illustrate the changes we observed, below is a graph of the Time To First Contentful Paint (TTFCP) for <a href="http://www.cloudflare.com">www.cloudflare.com</a> visits by real users during our test. TTFCP measures the first time something in the Document Object Model (DOM) is painted on the page. For websites that are primarily for consumption of content rather than heavy interactions, this is a closer representation of a user’s perception of your website speed than measuring load time.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/69COKNcTYBszg9BxaQNTZM/0fef1b1230c18d1c1c216de0cf7cfaef/Distribution-of-Time-To-First-Contentful-Paint-in-Baseline-vs-Rocket-Loader.png" />
            
            </figure><p>With Rocket Loader you can see those orange bars are grouped more to the left (faster) and higher meaning many more of our visitors were getting content on screen in under a second. In fact, the median improvement delivered by Rocket Loader during our <a href="http://www.cloudflare.com">www.cloudflare.com</a> test lands at a 0.93 second reduction in Time To First Contentful paint or around a 45% improvement over the baseline. Boom!</p>
    <div>
      <h3>What’s new in Rocket Loader</h3>
      <a href="#whats-new-in-rocket-loader">
        
      </a>
    </div>
    <p>So Rocket Loader continues to drive performance improvements on JavaScript heavy websites, but lots has changed under the hood. Here is a summary of the key changes:</p><ul><li><p>Improves time to first paint speed not just load time</p></li><li><p>Now compatible with over 93% of mobile devices<a href="#fn1">[1]</a></p></li><li><p>Tiny! Less than 10% of the size of prior version</p></li><li><p>Reduced complexity &amp; better compatibility with your on-site &amp; 3rd party JavaScripts</p></li><li><p>Compliant with stricter Content Security Policies (CSP)</p></li></ul>
    <div>
      <h4>More mobile users now get optimised</h4>
      <a href="#more-mobile-users-now-get-optimised">
        
      </a>
    </div>
    <p>We’ve already predicted that by the end of 2018 mobile usage will reach 60%. Additionally as of July 2018 Google will begin using page speed in <a href="https://webmasters.googleblog.com/2018/01/using-page-speed-in-mobile-search.html">mobile search ranking</a>. With that in mind providing a fast experience for mobile devices is more important than ever.</p><p>Rocket Loader beta was first launched back in 2012 at a time when mobile device usage on the web was around 15%. That version of Rocket Loader intercepted JavaScript on the page, and executed it in a virtual sandbox: a world familiar, but with behavior changed behind the scenes. Unfortunately, the technique we chose to create this virtual sandbox didn't work well on all mobile browsers. That was considered an undesirable but acceptable trade off 6 years ago, but today it’s vital customers can leverage this technique on mobile. Thanks to the reduced complexity of our approach, new Rocket Loader works on over 93%<a href="#fn1">[1:1]</a> of mobile devices in use today. For those devices that are not compatible, we simply deliver the website normally without this optimisation.</p>
    <div>
      <h4>Leaner &amp; Meaner</h4>
      <a href="#leaner-meaner">
        
      </a>
    </div>
    <p>New Rocket Loader’s JS weighs in at a lightweight 2.3KB. We did some <a href="/making-page-load-even-faster/">extensive refactoring</a> during 2017 that reduced the size of the JS required to run Rocket Loader from 47KB to 32KB and saved a staggering 213 terabytes of transfer across the globe. Due to the simplicity of the way New Rocket Loader works rocket-loader.min.js resulting in a JS file that is less than 10% of the size, saving approximately another 417 Terabytes of transfer each year when Rocket Loader does its thing.<a href="#fn2">[2]</a></p>
    <div>
      <h4>Compatibility with Content Security Policy</h4>
      <a href="#compatibility-with-content-security-policy">
        
      </a>
    </div>
    <p>New Rocket Loader does not modify the content of your JavaScript, it only changes the time at which it is loaded which means it plays nicely with any Content Security Policy (CSP) you have defined. With Rocket Loader beta, if you wanted to set a CSP that only allowed execution scripts hosted on your domain you would need to disable Rocket Loader as that would also combine &amp; load external JavaScripts through your domain. New Rocket Loader does not use this approach and instead lets the browser load &amp; cache the files normally. As we also enable HTTP/2 for all of our customers, any first party scripts will load over a single TCP connection, and 3rd party scripts are still asynchronously loaded meaning we can optimise their loading without proxying this content. All of this means modifying your CSP to accommodate Rocket Loader is as simple as allowing <code>script-src</code> for <code>https://ajax.cloudflare.com</code> so that Rocket Loader itself can load.</p>
    <div>
      <h3>How can I enable new Rocket Loader?</h3>
      <a href="#how-can-i-enable-new-rocket-loader">
        
      </a>
    </div>
    <p>If you already have Rocket Loader enabled as of today your site is using the new version. You can modify your settings at any time by visiting the Speed section of your Cloudflare settings.</p><p>If you had Rocket Loader disabled or in Manual mode just click the button in the Speed section to turn Rocket Loader on.</p>
    <div>
      <h3>What else can I do with Cloudflare to optimise my website?</h3>
      <a href="#what-else-can-i-do-with-cloudflare-to-optimise-my-website">
        
      </a>
    </div>
    <p>As always achieving good performance typically takes a variety of approaches and Rocket Loader tackles JavaScript specifically. There are some other very simple optimisations you should also ensure are enabled:</p><ul><li><p><b>Caching</b> - cache everything you can so content is served directly from any one of our 150+ data centres without waiting for your origin.</p></li><li><p><b>Minify &amp; Compress</b> - Enable minification of your HTML, <a href="https://www.cloudflare.com/learning/performance/how-to-minify-css/">CSS</a> &amp; JS in your Speed settings to losslessly reduce the total byte size of your web pages and enable Brotli compression so browsers that support this new compression method receive smaller responses.</p></li><li><p><b>Optimise your images</b> - Polish will automatically reduce the size of images on your website with support for highly efficient formats such as WebP. You can also turn on Mirage to optimise images for mobile devices with poor connectivity.</p></li><li><p><b>Use HTTP/2</b> - You get HTTP/2 support automatically as long as your site is served over HTTPS. Move as much as your content as you can onto your Cloudflare enabled URLs so all of that content can be multiplexed down a single TCP connection.</p></li><li><p><b>Use Argo &amp; Railgun</b> - For dynamic content Argo and Railgun can help optimise the connection &amp; transfer between Cloudflare and your origin server.</p></li></ul><hr /><ol><li><p>Rocket Loader utilises a browser API called <code>document.currentScript</code> which is currently supported by 93.7% of mobile devices and growing: <a href="https://caniuse.com/#feat=document-currentscript">https://caniuse.com/#feat=document-currentscript</a> <a href="#fnref1">↩︎</a> <a href="#fnref1:1">↩︎</a></p></li><li><p>Back of the envelope calculations based on 270 million rocket-loader.min.js responses served per week with a 29.7KB saving per serving. <a href="#fnref2">↩︎</a></p></li></ol> ]]></content:encoded>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Optimization]]></category>
            <guid isPermaLink="false">2nGGFnv0vU43zJm2VyHzAK</guid>
            <dc:creator>Simon Moore</dc:creator>
        </item>
        <item>
            <title><![CDATA[How we made our page-load optimisations even faster]]></title>
            <link>https://blog.cloudflare.com/making-page-load-even-faster/</link>
            <pubDate>Fri, 02 Feb 2018 16:41:00 GMT</pubDate>
            <description><![CDATA[ We improved the Lighthouse and time-to-first-meaningful-paint scores of two of our web optimisation products: Mirage and Rocket Loader! Combined, these products speed up around 1.2 billion web-pages a week. ]]></description>
            <content:encoded><![CDATA[ <p>In 2017 we made two of our web optimisation products - <a href="https://www.cloudflare.com/website-optimization/mirage/">Mirage</a> and <a href="https://vimeo.com/24900882">Rocket Loader</a> - even faster! Combined, these products speed up around 1.2 billion web-pages a week. The products are both around 5 years old, so there was a big opportunity to update them for the brave new world of highly-tuned browsers, HTTP2 and modern Javascript tooling. We measured a performance boost that, <a href="#savings">very roughly</a>, will save visitors to sites on our network between 50-700ms. Visitors that see content faster have much higher engagement and lower bounce rates, as shown by studies like <a href="https://www.doubleclickbygoogle.com/articles/mobile-speed-matters/">Google’s</a>. This really adds up, representing a further saving of 380 years of loading time each year and a staggering 1.03 petabytes of data transfer!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2I9Wjjv1mmUo8m0mpjQuiI/5678a5b42527782848dd62d462a0a8d6/dimon-blr-309444.jpg" />
            
            </figure><p>Cycling image Photo by <a href="https://unsplash.com/photos/mdgMbYfFlSA">Dimon Blr on Unsplash</a>.</p>
    <div>
      <h3>What Mirage and Rocket Loader do</h3>
      <a href="#what-mirage-and-rocket-loader-do">
        
      </a>
    </div>
    <p>Mirage and Rocket Loader both optimise the loading of a web page by reducing and deferring the number of assets the browser needs to request for it to complete HTML parsing and rendering on screen.</p>
    <div>
      <h4>Mirage</h4>
      <a href="#mirage">
        
      </a>
    </div>
    <p>.has_images { overflow: auto; } @media (min-width: 600px) { .has_images p { float: left; width: 50%; } .has_images img { float: right; margin: 1em; width: 40% } }</p><p>With Mirage, users on slow mobile connections will be quickly shown a full page of content, using placeholder images with a low file-size which will load much faster. Without Mirage visitors on a slow mobile connection will have to wait a long time to download high-quality images. Since it’ll take a long time, they will perceive your website as slow:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1IqZ5hbozfR4VXhvHoynn4/0cb6687cd157efb9c1973121c4f74809/Mirage---before-1.svg" />
            
            </figure><p>With Mirage visitors will see content much faster, will thus perceive that the content is loading quickly, and will be less likely to give up:</p>
    <div>
      <h4>Rocket Loader</h4>
      <a href="#rocket-loader">
        
      </a>
    </div>
    <p>Browsers will not show content that until all the Javascript that might affect it has been loaded and run. This can mean users wait a significant time before seeing any content at all, even if that content is the only reason they’re on visiting the page!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3ATanlKIoEw2yABAoJ4y8x/8e13860a0fee9ac69dbe52215c312eb4/Rocket-before.svg" />
            
            </figure><p>Rocket Loader transparently defers all Javascript execution until the rest of the page has loaded. This allows the browser to display the content the visitors are interested in as soon as possible.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4svTMwAb9yRtZ56uBpBZFR/71f80aa0175260d5e957ea663bf89451/Rocket-after.svg" />
            
            </figure>
    <div>
      <h3>How they work</h3>
      <a href="#how-they-work">
        
      </a>
    </div>
    <p>Both of these products involve a two step process: first our optimizing proxy-server will rewrite customers’ HTML as it’s delivered, and then our on-page Javascript will attempt to optimise aspects of the page load. For instance, Mirage's server-side rewrites image tags as follows:</p>
            <pre><code>&lt;!-- before --&gt;
&lt;img src="/some-image.png"&gt;

&lt;!-- after --&gt;
&lt;img data-cfsrc="/some-image.png" style="display:none;visibility:hidden;"&gt;</code></pre>
            <p>Since browsers don't recognise <code>data-cfsrc</code>, the Mirage Javascript can control the whole process of loading these images. It uses this opportunity to intelligently load placeholder images on slow connections.</p><p>Rocket Loader uses a similar approach to de-prioritise Javascript during page load, allowing the browser to show visitors the content of the page sooner.</p>
    <div>
      <h3>The problems</h3>
      <a href="#the-problems">
        
      </a>
    </div>
    <p>The Javascript for both products was written years ago, when <a href="https://github.com/rollup/rollup">‘rollup’</a> brought to mind a poor lifestyle choice rather than an excellent build-tool. With the big changes we’ve seen in browsers, protocols, and JS, there were many opportunities to optimise.</p>
    <div>
      <h4>Dynamically... slowing things down</h4>
      <a href="#dynamically-slowing-things-down">
        
      </a>
    </div>
    <p>Designed for the ecosystem of the time, both products were loaded by Cloudflare’s <a href="https://github.com/amdjs/amdjs-api/wiki/AMD">asynchronous-module-definition</a> (AMD) loader, called CloudflareJS, which also bundled some shared libraries.</p><p>This meant the process of loading Mirage or Rocket Loader looked like:</p><ol><li><p>CFJS inserted in blocking script tag by server-side rewriter</p></li><li><p>CFJS runs, and looks at some on-page config to decide at runtime whether to load Rocket/Mirage via AMD, inserting new script tags</p></li><li><p>Rocket/Mirage are loaded and run</p></li></ol>
    <div>
      <h4>Fighting browsers</h4>
      <a href="#fighting-browsers">
        
      </a>
    </div>
    <p>Dynamic loading meant the products could not benefit from optimisations present in modern browsers. Browsers now scan HTML as they receive it instead of waiting for it all to arrive, identifying and loading external resources like script tags as quickly as possible. This process is called <a href="https://andydavies.me/blog/2013/10/22/how-the-browser-pre-loader-makes-pages-load-faster/">preload scanning</a>, and is one of the most important optimisations performed by the brower. Since we used dynamic code inside CFJS to load Mirage and Rocket Loader, we were preventing them from benefitting from the preload scanner.</p><p>To make matters worse, Rocket Loader was being dynamically inserted using that villain of the DOM API, <code>document.write</code> - a technique that creates huge performance problems. Understanding exactly why is involved, so I’ve created a diagram. Skim it, and refer back to it as you read the next paragraph:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/45iYLM7SRhBk216L8GaIZJ/5c51258d80880a7bb433e6b51ead3d8f/Old-version.svg" />
            
            </figure><p>As said, using <code>document.write</code> to insert scripts is be particularly damaging to page load performance. Since the <code>document.write</code> that inserts the script is invisible to the preload scanner (even if the script is inline, which ours isn’t, preload scanning <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=575850">doesn’t</a> even attempt to scan JS), at the instant it is inserted the browser will already be busy requesting resources the scanner found elsewhere in the page (other script tags, images etc). This matters because a browser encountering a non-deferred or asynchronous Javascript, like Rocket Loader, must block all further building of the DOM tree until that script is loaded and executed, to give the script a chance to modify the DOM. So Rocket Loader was being inserted at an instant in which it was going to be very slow to load, due to the backlog of requests from the preload scan, and therefore causes a very long delay until the DOM parser can resume!</p><p>Aside from this grave performance issue, it became more urgent to remove <code>document.write</code> when <a href="https://www.chromestatus.com/feature/5718547946799104">Chrome began to intervene against it in version 55</a> triggering a <a href="https://github.com/WICG/interventions/issues/17">very interesting discussion</a>. This intervention would sometimes prevent Rocket Loader from being inserted on slow 2G connections, stopping any other Javascript from loading at all!</p><p>Clearly, <code>document.write</code> needed to be extirpated!</p>
    <div>
      <h4>Unused and over-general code</h4>
      <a href="#unused-and-over-general-code">
        
      </a>
    </div>
    <p>CFJS was authored as a shared library for Cloudflare client-side code, including the original Cloudflare app store. This meant it had quite a large set of APIs. Although both Mirage and Rocket Loader depended on some of them, the overlap was actually small. Since we've launched the new, shiny <a href="/cloudflare-apps-2/">Cloudflare Apps</a>, CFJS had no other important products dependant upon it.</p>
    <div>
      <h3>A plan of action</h3>
      <a href="#a-plan-of-action">
        
      </a>
    </div>
    <p>Before joining Cloudflare in July this year, I had been working in TypeScript, a language with all the lovely new syntax of modern Javascript. Taking over multiple AMD, ES5-based projects using Gulp and Grunt was a bit of a shock. I really thought I'd written my last <code>define(['writing', 'very-bug'], function(twice, prone) {})</code>, but here I was in 2017 seeing it again!</p><p>So it was very tempting to do a big-bang rewrite and get back to playing with the new ECMAScript 2018 toys. However, I’ve been involved in enough rewrites to know they’re <a href="https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/">very rarely justified</a>, and instead identified the highest priority changes we’d need to improve performance (though I admit I wrote a few <code>git checkout -b typescript-version</code> branches to vent).</p><p>So, the plan was:</p><ol><li><p>identify and inline the parts of CFJS used by Mirage and Rocket Loader</p></li><li><p>produce a new version of the other dependencies of CFJS (our <a href="https://www.cloudflare.com/logo">logo badge widget</a> is actually hardcoded to point at CloudflareJS)</p></li><li><p>switch from AMD to Rollup (and thus ECMAScript import syntax)</p></li></ol><p>The decision to avoid making a new shared library may be surprising, especially as tree-shaking avoids some of the code-size overhead from unused parts of our dependencies. However, a little duplication seemed the lesser evil compared to cross-project dependencies given that:</p><ul><li><p>the overlap in code used was small</p></li><li><p>over-general, library-style functions were part of why CFJS became too big in the first place</p></li><li><p>Rocket Loader has some exciting things in its future...</p></li></ul><p>Sweating kilobytes out of the minified + Gzipped Javascript files is be a waste of time for most applications. However, in the context of code that'll be run literally millions of times in the time you read this article, it really pays off. This is a process we’ll be continuing in 2018.</p>
    <div>
      <h4>Switching out AMD</h4>
      <a href="#switching-out-amd">
        
      </a>
    </div>
    <p>Switching out Gulp, Grunt and AMD was a fairly mechanical process of replacing syntax like this:</p>
            <pre><code>define(['cloudflare/iterator', 'cloudflare/dom'], function(iterator, dom) {
    // ...
    return {
        Mirage: Mirage,
    };
})</code></pre>
            <p>with ECMAScript modules, ready for Rollup, like:</p>
            <pre><code>import * as iterator from './iterator';
import { isHighLatency } from './connection';

// ...

export { Mirage }</code></pre>
            
    <div>
      <h4>Post refactor weigh-in</h4>
      <a href="#post-refactor-weigh-in">
        
      </a>
    </div>
    <p>Once the parts of CFJS used by the projects were inlined into the projects, we ended up with both Rocket and Mirage being slightly <a href="#badge">larger</a> (all numbers minified + GZipped):</p><p>So we made a significant file-size saving (about <a href="https://mathiasbynens.be/demo/jquery-size">half a jQuery’s worth</a>) vs the original file-size required to completely load either product.</p>
    <div>
      <h4>New insertion flow</h4>
      <a href="#new-insertion-flow">
        
      </a>
    </div>
    <p>Before, our original insertion flow looked something like this:</p>
            <pre><code>// on page embed, injected into customers' pages
&lt;script&gt;
  var cloudflare = { rocket: true, mirage: true };
&lt;/script&gt;
&lt;script src="/cloudflare.min.js"&gt;&lt;/script&gt;</code></pre>
            <p>Inside cloudflare.min.js we found the dynamic code that, once run, would kick off the requests for Mirage and Rocket Loader:</p>
            <pre><code>// cloudflare.min.js
if(cloudflare.rocket) {
    require(“cloudflare/rocket”);
}</code></pre>
            <p>Our approach is now far more browser friendly, roughly:</p>
            <pre><code>// on page embed
&lt;script&gt;
  var cloudflare = { /* some config */ }
&lt;/script&gt;
&lt;script src="/mirage.min.js"&gt;&lt;/script&gt;
&lt;script src="/rocket.min.js"&gt;&lt;/script&gt;</code></pre>
            <p>If you compare the new insertion sequence diagram, you can see why this is so much better:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6UOAgrBB8DitoNbPqlG6yP/606fb38481f2a760ec1d2ab26e1d786a/New-Version.svg" />
            
            </figure>
    <div>
      <h3>Measurement</h3>
      <a href="#measurement">
        
      </a>
    </div>
    <p>Theory implied our smaller, browser-friendly strategy should be faster, but only by doing some good old empirical research would we know <a href="#hume">for sure</a>.</p><p>To measure the results, I set up a representative test page (including Bootstrap, custom fonts, some images, text) and calculated the change in the average <a href="https://developers.google.com/web/tools/lighthouse">Lighthouse</a> performance scores out of 100 over a number of runs. The metrics I focussed on were:</p><ol><li><p>Time till first meaningful paint (TTFMP) - FMP is when we first see some useful content, e.g. images and text</p></li><li><p>Overall - this is Lighthouse's aggregate score for a page - the closer to 100, the better</p></li></ol>
    <div>
      <h4>Assessment</h4>
      <a href="#assessment">
        
      </a>
    </div>
    <p>So, improved metrics across the board! We can see the changes have resulted in solid improvements, e.g a reduction in our average time till first meaningful paint of 694ms for Rocket, and 49ms for Mirage.</p>
    <div>
      <h3>Conclusion</h3>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>The optimisations to Mirage and Rocket Loader have resulted in less bandwidth use, and measurably better performance for visitors to Cloudflare optimised sites.</p>
    <div>
      <h4>Footnotes</h4>
      <a href="#footnotes">
        
      </a>
    </div>
    <p>a:not([href]) { text-decoration: inherit !important; color: inherit !important; }</p><ol><li><p>The following are back-of-the-envelope calculations. Mirage gets 980 million requests a week, TTFMP reduction of 50ms. There are 1000 ms in a second * 60 seconds * 60 minutes * 24 hours * 365 days = 31.5 billion milliseconds in a year. So (980e6 * 50 * 52) / 31.5e9 = in aggregate, 81 years less waiting for first-paint. Rocket gets 270 million requests a week, average TTFMP reduction of 694ms, (270e6 * 694 * 52) / 31.5e9 = in aggregate, 301 years less waiting for first-meaningful-paint. Similarly 980 million savings of 16kb per week for Mirage = 817.60 terabytes per year and 270 million savings of 15.2kb per week for Rocket Loader = 213.79 terabytes per year for a combined total of 1031 terabytes or 1.031 petabytes.</p></li><li><p>and a tiny 1.5KB file for our <a href="https://www.cloudflare.com/logo">web badge</a> - written in TypeScript ? - which previously was loaded on top of the 21.6KB CFJS</p></li><li><p><a href="https://plato.stanford.edu/entries/induction-problem/">shut it Hume</a></p></li><li><p>Thanks to Peter Belesis for doing the initial work of identifying which products depended upon CloudflareJS, and Peter, Matthew Cottingham, Andrew Galloni, Henry Heinemann, Simon Moore and Ivan Nikulin for their wise counsel on this blog post.</p></li></ol> ]]></content:encoded>
            <category><![CDATA[Mirage]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">1L8o6pa1yUW2uEUgXk0W0M</guid>
            <dc:creator>Tim Ruffles</dc:creator>
        </item>
        <item>
            <title><![CDATA[Prepare Your Site for Traffic Spikes this Holiday Season]]></title>
            <link>https://blog.cloudflare.com/prepare-your-site-for-traffic-spikes-this-holiday-season/</link>
            <pubDate>Mon, 17 Nov 2014 19:46:32 GMT</pubDate>
            <description><![CDATA[ The holiday season is approaching, and everyone is thinking about gifts for their friends and family. As people increasingly shop online, this means huge spikes in traffic for web sites---especially ecommerce sites. ]]></description>
            <content:encoded><![CDATA[ <p>The holiday season is approaching, and everyone is thinking about gifts for their friends and family. As people increasingly shop online, this means huge spikes in traffic for web sites---especially <a href="https://www.cloudflare.com/ecommerce/">ecommerce sites</a>. We want you to get the most out of this year’s surge in web traffic, so we’ve created a list of tips to help you prepare your site to ensure your visitors have a reliable and fast experience.</p>
    <div>
      <h3>Make sure your site can handle traffic spikes:</h3>
      <a href="#make-sure-your-site-can-handle-traffic-spikes">
        
      </a>
    </div>
    
    <div>
      <h4>1) Contact your hosting provider to understand the limits of your hosting plan</h4>
      <a href="#1-contact-your-hosting-provider-to-understand-the-limits-of-your-hosting-plan">
        
      </a>
    </div>
    <p>Even though CloudFlare offsets most of the load to your website via caching and request filtering, a certain amount of traffic will still pass through to your host. Knowing the limits of your plan can help prevent a bottleneck from your hosting plan.</p>
    <div>
      <h4>2) Reduce the number of unwanted requests to your infrastructure</h4>
      <a href="#2-reduce-the-number-of-unwanted-requests-to-your-infrastructure">
        
      </a>
    </div>
    <p>CloudFlare allows you to block IP address individually or IPs from entire regions. If you don’t want or need traffic from certain IPs or regions, you can block them using your Threat Control panel. This is useful for sites who know where their visitors usually come from.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3s8MP4aiaRxucDbOkhJMMi/d0542918b04f81f95cdc51d6fa56476b/Screen-Shot-2014-11-14-at-2-03-26-PM.png" />
            
            </figure>
    <div>
      <h4>3) Use CloudFlare IP addresses to your advantage</h4>
      <a href="#3-use-cloudflare-ip-addresses-to-your-advantage">
        
      </a>
    </div>
    <p>Take action to prevent attacks to your site during peak season by configuring your firewall to only accept traffic from CloudFlare IP addresses during the holidays. If you only accept CloudFlare IPs, you can prevent attackers from getting to your original IP address and knocking your site offline.</p>
    <div>
      <h4>4) Ensure CloudFlare IPs are allowlisted</h4>
      <a href="#4-ensure-cloudflare-ips-are-allowlisted">
        
      </a>
    </div>
    <p>CloudFlare operates as a reverse proxy to your site so all connections come from CloudFlare IPs, so restricting our IPs can cause issues for visitors trying to access your site. The list of our IP can be found here: <a href="https://www.cloudflare.com/ips">https://www.cloudflare.com/ips</a></p>
    <div>
      <h4>5) Go beyond default caching for the fastest site possible</h4>
      <a href="#5-go-beyond-default-caching-for-the-fastest-site-possible">
        
      </a>
    </div>
    <p>By default CloudFlare <a href="https://support.cloudflare.com/hc/en-us/articles/200172516-Which-file-extensions-does-CloudFlare-cache-for-static-content-">caches static content</a> with our CDN; however, you can extend our caching by creating custom Page Rules. Under the Page Rules section of your account, you can set a pattern--either your entire website, or a section of your site--then turn on the “Cache everything” option. Creating a page rule and setting the Cache Everything option helps reduce the number of times CloudFlare has to hit your origin to download cacheable items.</p><p>Setting up a custom Page Rule like this is ideal if you have a campaign going on over the holiday season. With the Cache Everything option enabled, CloudFlare will be serving your entire site, taking the load off of your server completely, making you site as fast as possible.</p><p>Edge Cache Expire TTL and the Browser Cache Expire TTL allows you to determine how long we cache resources at our edge, and how long browsers will cache assets.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1qlwZv5c3n2HxcBFsvSgFp/044f535a5d8180f798b2fe640f3b57c3/page-rule.png" />
            
            </figure>
    <div>
      <h3>Further suggestions for optimizing CloudFlare:</h3>
      <a href="#further-suggestions-for-optimizing-cloudflare">
        
      </a>
    </div>
    
    <div>
      <h4>1) Make sure your back-end analytics are accurate</h4>
      <a href="#1-make-sure-your-back-end-analytics-are-accurate">
        
      </a>
    </div>
    <p>To ensure visitor’s IPs show in your back-end server logs you can install mod_cloudflare to restore original visitor IP back to server logs. Our IP addresses will show up in your logs unless you install the modification to make sure you are logging the visitors’ actual IP addresses.</p>
    <div>
      <h4>2) Turn on Auto Minification to send as little data as possible</h4>
      <a href="#2-turn-on-auto-minification-to-send-as-little-data-as-possible">
        
      </a>
    </div>
    <p>Auto Minification is a method that helps your site send as little information as possible to <a href="https://www.cloudflare.com/solutions/ecommerce/optimization/">increase performance</a>. It works by taking JavaScript, CSS, and HTML and removing all comments and white spaces.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3aOvBeekAAcIcjiNZCD2on/2aadbf3fb6bd3421453da6c16fe77e12/minify.png" />
            
            </figure>
    <div>
      <h4>3) Turn on Rocket Loader to send data in the right order</h4>
      <a href="#3-turn-on-rocket-loader-to-send-data-in-the-right-order">
        
      </a>
    </div>
    <p>Rocket Loader is an asynchronous JavaScript loader. It ensures that individual scripts on your page won’t block other content from loading, loads third party scripts in the order they are ready, and bundles all script into a single request so multiple responses can be streamed---in short, it makes your page render much faster on any device.</p><p>At a high level, Rocket Loader works like this:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5wqhAv5VJwSzBeQRASEphv/cd283c9c7fd2de32d7e54649f2f5770b/rocket_loader_diagram-png-scaled500-1.png" />
            
            </figure>
    <div>
      <h4>4) Turn on Mirage to lazy load images</h4>
      <a href="#4-turn-on-mirage-to-lazy-load-images">
        
      </a>
    </div>
    <p><i>(Available for Pro, Business, and Enterprise plans)</i>Mirage will determine which images are visible to the end user and send those first, then other images that are off the screen will be lazy loaded as needed. This feature is especially useful for sites that with many images like most ecommerce sites</p><p>For example: if your sites has a images of seventy different t-shirts for sale, rather than having the customer wait for all seventy images to load, Mirage quickly delivers the images immediately visible to the user, then loads the rest of the images as the customer scrolls down. By having the most important images load lightning fast, the end user’s experience is improved.</p>
    <div>
      <h4>5) Turn on Polish to compress images</h4>
      <a href="#5-turn-on-polish-to-compress-images">
        
      </a>
    </div>
    <p><i>(Available for Pro, Business, and Enterprise plans)</i>Polish recompresses images to make them as small as possible in order to increase site performance.</p><p>For example: You may have images on your site that are not optimally compressed. When CloudFlare puts those images into cache it will automatically recompress them making them smaller, and allowing them to be loaded as quickly as possible. CloudFlare can <a href="https://www.cloudflare.com/learning/performance/glossary/what-is-image-compression/">compress images</a> in a lossless or lossy way.</p>
    <div>
      <h4>6) Make sure those last minute changes are seen</h4>
      <a href="#6-make-sure-those-last-minute-changes-are-seen">
        
      </a>
    </div>
    <p>If you want to make quick changes to your page and have your visitors see that change immediately, you can purge individual files from CloudFlare’s cache.</p><p>For example, if you are running a sale only for Black Friday, and you want new content displayed to your visitors, you can purge a single page so that CloudFlare will return to your origin server to fetch a new version of that page for our cache.</p><p>Please Note: if you purge your entire cache your origin will receive a flood of traffic until CloudFlare get all of your assets back into our cache.</p>
    <div>
      <h3>One last thing</h3>
      <a href="#one-last-thing">
        
      </a>
    </div>
    <p>Even if you don’t implement any of the suggestions above you are still ahead of the game by being on CloudFlare’s network. Since we have 28 data centers around the world, we bring your site close to your visitors. And since we run an Anycast network, visitors are automatically directed to the closest data center meaning that your site will be faster as the request travels over a shorter distance.</p><p>We wish you all the best this holiday season! Good luck!</p> ]]></content:encoded>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Holidays]]></category>
            <category><![CDATA[eCommerce]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Mirage]]></category>
            <category><![CDATA[Cloudflare Polish]]></category>
            <category><![CDATA[AutoMinify]]></category>
            <guid isPermaLink="false">2JgfRGd3lltJN4wMWrFngF</guid>
            <dc:creator>Andrew A. Schafer</dc:creator>
        </item>
        <item>
            <title><![CDATA[Ask CloudFlare: How do I make my website faster?]]></title>
            <link>https://blog.cloudflare.com/ask-cloudflare-how-do-i-make-my-website-faster/</link>
            <pubDate>Tue, 10 Dec 2013 10:00:00 GMT</pubDate>
            <description><![CDATA[ We get asked this question all the time: How do I make my website faster? So, on Thursday, we're holding a webcast to go through our recommendations and also answer your questions live. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>We get asked this question all the time: How do I make my website faster? So, on Thursday, we're holding a webcast to go through our recommendations and also answer your questions live.</p><p>We'll discuss:</p><ul><li><p>the basics of getting set up for speed</p></li><li><p>what to cache and why</p></li><li><p>image optimization and virtualization techniques (Polish and Mirage)</p></li><li><p>JavaScript optimization (Rocket Loader)</p></li></ul><p>This session is geared toward website owners who want to understand the basics of performance on CloudFlare and who may have no prior knowledge of our service. CloudFlare makes your websites faster, safer and smarter. Join us on Thursday, December 12 from 10 to 10:30am Pacific (18:00 to 18:30pm UTC) and we'll show you how simple it is to go faster. <a href="https://plus.google.com/events/c682tol03115p895560qidko5lo">Register here.</a></p> ]]></content:encoded>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Webinars]]></category>
            <category><![CDATA[Events]]></category>
            <category><![CDATA[JavaScript]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <guid isPermaLink="false">6kZn6UTo2XqMZAAhZuB348</guid>
            <dc:creator>Kristin Tarr</dc:creator>
        </item>
        <item>
            <title><![CDATA[Facebook Bug Redirects the Web Through Javascript Widget Error]]></title>
            <link>https://blog.cloudflare.com/facebook-bug-takes-down-much-of-the-web-cloud/</link>
            <pubDate>Fri, 08 Feb 2013 05:08:00 GMT</pubDate>
            <description><![CDATA[ You may have heard that Facebook took down a significant portion of the Internet today. A bug in their Facebook Connect script caused users to be redirected to a Facebook error page. ]]></description>
            <content:encoded><![CDATA[ <p>You may have heard that <a href="http://allthingsd.com/20130207/in-one-fell-swoop-apparent-facebook-glitch-deep-sixes-the-web/">Facebook took down a significant portion of the Internet today</a>. A bug in their Facebook Connect script -- which is installed widely across many sites including CNN, MSNBC.com, New York Magazine, and many more places -- caused users to be redirected to a Facebook error page. Here's a video of what it looked like if you visited NBCNews.com:</p><p>The incident raises two good points: 1) the risk of Javascript widgets creating a "single points of failure" on your web page; and 2) the ways in which CloudFlare can help protect you from similar errors.</p>
    <div>
      <h3>Widgets &amp; SPOF</h3>
      <a href="#widgets-spof">
        
      </a>
    </div>
    <p>Facebook Connect works as a piece of Javascript that is embeded on pages. When the bug occurred, the Javascript effectively hijacked the page and directed it somewhere else. It may seem like installing a widget such as the Facebook button is harmless, but today's incident shows how much harm it can actually cause.</p><p><a href="http://twitter.com/BjoernKaiser">Björn Kaiser</a> wrote a <a href="http://calendar.perfplanet.com/2012/spof-bug/">great blog post last year about the risks that embedded Javascript widgets can create</a>, and how their failure can create a single point of failure (SPOF) on your site. In the post, he describes how you can test the embedded widgets on your page to see what would happen if any of them fail. Given that no widget provider, even Facebook, is infallible it is important to understand the risk of widget failure bringing down your site.</p>
    <div>
      <h3>How CloudFlare Helps</h3>
      <a href="#how-cloudflare-helps">
        
      </a>
    </div>
    <p>There are two distinct ways in which CloudFlare helps protect you from Javascript widgets taking down your site. The first is via our Rocket Loader feature.</p><p>While we don't describe it this way often, <a href="/56590463">Rocket Loader</a> is effectively an on-page Javascript optimizer. It sits in front of widgets and makes sure they load as fast as possible. It also has a number of failsafes that can protect from any widget hijacking your site the way Facebook's Connect service did today. While we primarily describe Rocket Loader as a performance feature, in this role it's also very helpful for security and site availability.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3D3DQTM5K6OYT7XBXsGfQh/23ea3afea864426f4980e58827f2c593/rocket.png.scaled500.png" />
            
            </figure><p>The second way we protect sites from misbehaving Javascript widgets is through CloudFlare's app store. Many CloudFlare apps are Javascript widgets of one kind or another. When you install any CloudFlare app, we go through the process of making sure that the app performs well and can run asychronously. This greatly reduces the risk of an CloudFlare-installed app becoming a SPOF. Moreover, because we can install, upgrade, and remove apps centrally, if a problem likeFacebook's had occurred with one of the CloudFlare apps, we could quickly remove it from pages to keep it from causing harm.</p>
    <div>
      <h3>#savetheweb</h3>
      <a href="#savetheweb">
        
      </a>
    </div>
    <p>Today's Facebook incident shows the risks of misbehaving Javascript widgets, but it also helps drive home the point on how CloudFlare is really building a better web. To that end, we will continue to invest in improving Rocket Loader and adding more and more apps to the CloudFlare Apps Marketplace. If you haven't turned on Rocket Loader or added an app through the <a href="http://www.cloudflare.com/apps">CloudFlare Apps Marketplace</a>, you now have one more reason check them both out.</p> ]]></content:encoded>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">7dCkd6C6h6fOBTiWviMhTV</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[WordPress London Meetup January 2013]]></title>
            <link>https://blog.cloudflare.com/wordpress-london-meetup-january-2013/</link>
            <pubDate>Fri, 18 Jan 2013 09:23:00 GMT</pubDate>
            <description><![CDATA[ Last night I gave a short presentation about how to use CloudFlare with WordPress sites to about 60 people attending the WordPress London Meetup. CloudFlare was happy to be sponsor of the event providing drinks, beers and lots and lots of pizza. The meetup was held at the Google Campus. ]]></description>
            <content:encoded><![CDATA[ <p>Last night I gave a short presentation about how to use CloudFlare with WordPress sites to about 60 people attending the <a href="http://www.meetup.com/London-WordPress/events/81910532/">WordPress London Meetup</a>. CloudFlare was happy to be sponsor of the event providing drinks, beers and lots and lots of pizza. The meetup was held at the <a href="http://www.campuslondon.com">Google Campus</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2bdYQMglHyT6gy21JAG1Q/9c2bd44b605eb215f9d3e5ce99a3cf0f/IMG_4277.JPG.scaled500.jpg" />
            
            </figure><p>There were two talks: I was preceded by designer <a href="http://laurakalbag.com/">Laura Kalbag</a> who talked about designing icons for WordPress sites. This is something that she made look incredibly easy using a tool called <a href="http://www.bohemiancoding.com/sketch/">Sketch</a>. I suspect that however good Sketch is, I'd end up drawing icons that looked awful!</p><p>My talk was about using WordPress and CloudFlare together. CloudFlare has a ton of features and I highlighted some that are of great interest to WordPress users including the <a href="http://wordpress.org/extend/plugins/cloudflare/">CloudFlare WordPress Plugin</a> and our integration with <a href="/w3-total-cache-w3tc-total-cloudflare-integrat">W3TC</a>.</p><p>The other features that people found most interesting were:</p><ol><li><p><a href="/always-online-v2">Always Online</a>: CloudFlare crawls the WordPress site and keeps a copy in a special cache. If the original site goes down CloudFlare serves up the most recent version from the crawler cache with a banner indicating that it is old content. This helps keep sites online when things go badly wrong.</p></li><li><p><a href="/an-all-new-and-improved-autominify">Auto-minify</a>: many WordPress sites have large amount of HTML, <a href="https://www.cloudflare.com/learning/performance/how-to-minify-css">CSS</a>, and JavaScript (especially if they use lots of plugins). Auto-minify helps shrink those resources so that sites are delivered faster to web browsers.</p></li><li><p><a href="/how-cloudflare-rocket-loader-redefines-the-modern-cdn/">Rocket Loader</a>: a tool that reorganizes the loading of resources such as CSS and JavaScript to that they are downloaded to web browsers quickly by bundling them.</p></li><li><p>A new, unannounced feature that I'm calling "Help, I've gone viral!" which allows any web site owner to instantly tell CloudFlare to start completely caching a URL (overriding any caching headers set by the site) to cope with load. With this if a URL goes viral and is overloading a WordPress site it's possible to just paste in its URL and ask CloudFlare to take the load of that page. We'll be writing more about that feature when it's released.</p></li></ol><p>And, of course, other CloudFlare features like <a href="/easiest-ssl-ever-now-included-automatically-w">Easy SSL</a>, <a href="/spdy-now-one-click-simple-for-any-website">SPDY</a>, and <a href="/introducing-cloudflares-automatic-ipv6-gatewa">IPv6</a> help everyone get the latest technology onto their site quickly.</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Meetups]]></category>
            <category><![CDATA[WordPress]]></category>
            <category><![CDATA[Always Online]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[United Kingdom]]></category>
            <category><![CDATA[Community]]></category>
            <guid isPermaLink="false">5Pz6V8TXfn781DSko28qnf</guid>
            <dc:creator>John Graham-Cumming</dc:creator>
        </item>
        <item>
            <title><![CDATA[WSJ: CloudFlare Named Most Innovative Internet & Networking Company, Second Year in a Row]]></title>
            <link>https://blog.cloudflare.com/wsj-cloudflare-named-most-innovative-internet/</link>
            <pubDate>Mon, 15 Oct 2012 23:25:00 GMT</pubDate>
            <description><![CDATA[ We just got word from the Wall Street Journal that CloudFlare was named the Most Innovative Internet & Networking Company of 2012. This is the second year in a row that CloudFlare has won this award.  ]]></description>
            <content:encoded><![CDATA[ <p>We just got word from the <i>Wall Street Journal</i> that CloudFlare was named the <a href="http://online.wsj.com/article/SB10000872396390444024204578046911546099812.html?mod=googlenews_wsj">Most Innovative Internet &amp; Networking Company of 2012</a>. This is the second year in a row that <a href="/wall-street-journal-cloudflare-the-most-innov">CloudFlare has won this award</a>. Given the pace of development of new technologies on the Internet, that is high praise for the innovations our team has brought to market over the last year.</p><p>In announcing the award, the <i>WSJ</i> specifically called out three technologies we launched over the last year: Rocket Loader, Railgun, and the Automatic IPv6 Gateway.</p>
    <div>
      <h3>Rocket Loader</h3>
      <a href="#rocket-loader">
        
      </a>
    </div>
    <p>Rocket Loader helps ensure that scripts and other resources don't slow down page load times. Too often, third party scripts like buttons, widgets, and ads can block a page from loading. These problems are exacerbated on mobile devices. Since mobile bandwidth is limited, and connections are fickle, needing to open connections to multiple third party services can seriously degrade mobile performance.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3tmr1JdKRWxh07qSTRUPVk/20808bb7e6081b53041761b740eeb997/rocket.png.scaled500.png" />
            
            </figure><p>Rocket Loader's <a href="/56590463">innovative approach</a> fetches multiple third party objects through a single connection to CloudFlare's network. Instead of needing to open new requests to each service, a device only needs to establish a single connection to CloudFlare's network. Our servers, which do not have the same constraints, can then open connections to all the services needed to download the objects. The net result is pages load faster and aren't blocked if an ad or Twitter button fails to load quickly.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7K0Y0fSU9JIbelJW8WMyaT/6d103bfa501fab38584879eea31254d2/rocket_loader_diagram.png.scaled500.png" />
            
            </figure><p>Rocket Loader is <a href="http://www.cloudflare.com/features-optimizer">available to all CloudFlare customers for free</a>. We've found it often improves page load performance an additional 30% over the other benefits delivered by CloudFlare's systems, with the biggest performance gains seen on mobile devices.</p>
    <div>
      <h3>Railgun</h3>
      <a href="#railgun">
        
      </a>
    </div>
    <p>The caching model for the Internet is based on files. CloudFlare caches static files (images, CSS, Javascript) at our edge and, in doing so, saves approximately 70% of the average websites' bandwidth and requests. While CloudFlare works well with dynamic content, since the file changes it is impossible for it to be cached.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/d7DmUQQNlOAxhHzlyHqWu/f797808a1767a6f4f532ee8c81672cc2/railgun-illustration.png.scaled500.png" />
            
            </figure><p>CloudFlare spent a year studying the properties of the dynamic web. In the process, we realized that while many sites are dynamic, the amount they actually change is very small: less than 5% every 24 hours. Railgun <a href="/cacheing-the-uncacheable-cloudflares-railgun-73454">changes the caching model</a> of the Internet to allow only the portions of a file that have changed to be sent across the network.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6unZEo3zz2bihjZh19HSnG/12efc51c07e82294c3c1b11a747a1e8b/railgun-overview.png.scaled500.png" />
            
            </figure><p>Railgun was inspired by CloudFlare's continued <a href="http://www.cloudflare.com/network-map">expansion of data centers</a>. As CloudFlare's network grew to include 23 data centers, the latency from a browser to our network shrank. However, the latency from our network back to our customers' web servers grew. Business and Enterprise customers, as well as customers on CloudFlare <a href="http://www.cloudflare.com/hosting-partners">Optimized Hosting Partners</a>, can use Railgun to achieve a 99.6% compression ratio when sending data to our network. That means what used to take 200 packets can now be sent in a single packet and, more practically, even highly dynamic sites can, for the first time, be as fast as if the data center were next door regardless of where a visitor is surfing from.</p>
    <div>
      <h3>Automatic IPv6 Gateway</h3>
      <a href="#automatic-ipv6-gateway">
        
      </a>
    </div>
    <p>One of the most vexing challenges the Internet faces is the move from IPv4 to IPv6. The IPv4 protocol was designed to only accommodate approximately 4 billion devices simultaneously connected to the network at any given time. As we close in on this theoretical limit we are literally running out of addresses. While it's hard to imagine, that means the seemingly limitless Internet is running out of space.</p><p>The solution is a new protocol — IPv6 — which can support a vastly larger number of connected devices. Unfortunately, IPv6 networks cannot interoperate with IPv4 networks meaning the Internet has been faced with a giant chicken-or-egg problem. Web surfers are reluctant to upgrade to IPv6 because there's no IPv6 web content, and web publishers are reluctant to switch because there are not IPv6 web surfers.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/544qENHrjZWaFwbgJoWWAr/501914ef3fd7f6edc8608f28a1bac8c2/ipv6-ipv4.gif.scaled500.gif" />
            
            </figure><p>CloudFlare realized we could help solve this problem by providing our <a href="/ipv6-challenge-to-the-web">Automatic IPv6 Gateway</a>. The free service allows anyone to maintain their existing IPv4 infrastructure and be available on the IPv6 web just by signing up for CloudFlare. While that is great for existing customers, the bigger opportunity is actually with new entrants to the Internet. As it becomes more expensive to launch an IPv4 infrastructure, CloudFlare will allow new Internet publishers to put their content on IPv6 but still reach legacy IPv4 surfers.</p><p>CloudFlare's Automatic IPv6 Gateway was so successful that CloudFlare doubled the number of IPv6 websites available the day we launched the product. Today, CloudFlare provides IPv6 connectivity to more websites than any other provider.</p>
    <div>
      <h3>Not Slowing Down</h3>
      <a href="#not-slowing-down">
        
      </a>
    </div>
    <p>CloudFlare's team comes to work every day excited to invent the future of the Internet. Our goal is nothing short of rebuilding a faster, safer, smarter web. We are honored to be recognized by the <i>Wall Street Journal</i> for the <a href="/wall-street-journal-cloudflare-the-most-innov">second year in a row</a> as one of the world's most innovative companies. And we're hard at work on the next technologies in our continuing efforts to build a better Internet.</p><p>You can read more about CloudFlare's award on the <a href="http://online.wsj.com/article/SB10000872396390444024204578046911546099812.html">Wall Street Journal's website</a>.</p> ]]></content:encoded>
            <category><![CDATA[IPv6]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">7swrYu8Pat9uKNb4ORm2IO</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[Why mobile performance is difficult]]></title>
            <link>https://blog.cloudflare.com/why-mobile-performance-is-difficult/</link>
            <pubDate>Thu, 28 Jun 2012 06:48:00 GMT</pubDate>
            <description><![CDATA[ Mobile web browsing is very different, at the network level, to browsing on a desktop machine connected to the Internet. Yet both use the very same protocols, and although TCP was designed to perform well on the fixed-line Internet, it doesn't perform as well on mobile networks.  ]]></description>
            <content:encoded><![CDATA[ <p>Mobile web browsing is very different, at the network level, to browsing on a desktop machine connected to the Internet. Yet both use the very same protocols, and although TCP was designed to perform well on the fixed-line Internet, it doesn't perform as well on mobile networks. This post looks at why and how CloudFlare is helping.</p><p>We start with a simple ping. Here's a ping from my laptop machine (which is connected via 802.11g WiFi to a 20Mbps broadband connection) to a machine at Google. Looks like I'm getting a roundtrip time of about 20ms.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4SPeLtpDF4TnhjvUGYVQjI/7d91273e0b26466302edeeba9a2a155e/Screen_Shot_2012-06-27_at_4.22.50_PM.png.scaled500.png" />
            
            </figure><p>Here's the same ping done from my iPhone on the same WiFi network at the same location in the house. The ping time has gone up to about 60ms. So, in this instance, the round trip time had tripled just from going from laptop to phone.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3JLqXO7BfXiHbgvw3UugBE/066ea75ff0c3e6097c7c64fe8283136a/IMG_3783.PNG.scaled500.png" />
            
            </figure><p>But to see the real cost of mobile it's necessary to switch off WiFi and onto 3G. Here's the ping time on 3G to the same machine. Here's it's both much higher (we're now into 1/10 to 1/5 of a second territory) but it's also variable:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6ndn2280K7W1PByFoFpGLW/92fa0ee7f48ee38ea3e26d87bb99928a/IMG_3777.PNG.scaled500.png" />
            
            </figure><p>And then I get up and move to the front of the house and try again. The ping time has changed completely (the number of bars didn't) and I'm seeing between 0.5s and 1s of round trip time. That will have a serious effect on web browsing.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7Gi1744fWZEvvbYSMDifD0/8d44a485457558e4678b85750459e8f4/IMG_3778.PNG.scaled500.png" />
            
            </figure><p>And for a final test I return to my original location and grip the iPhone firmly in my hand. The number of bars falls away and the round trip time becomes infinite! Pings simply aren't working any more.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/dzdtT2vNyMnykyPsFSqM5/aabcce5584a061aecc511d0830c85d22/IMG_3781.PNG.scaled500.png" />
            
            </figure><p>What this illustrates is something that any smartphone user knows instinctively: network performance on phone is very variable and susceptible to location and environment. TCP would actually work just fine on a phone except for one small detail: phones don't stay in one location. Because they move around (while using the Internet) the parameters of the network (such as the latency) between the phone and the web server are changing and TCP wasn't designed to detect the sort of change that's happening.</p><p>In past posts I've looked at the effect of <a href="/the-bandwidth-of-a-boeing-747-and-its-impact">high latency on web browsing</a> and <a href="/the-bandwidth-of-a-boeing-747-and-its-impact">TCP's connection and slow start cost</a>. One of the fundamental parts of the TCP specification covers congestion avoidance: the <a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol#Congestion_control">detection and avoidance of congestion</a> on the Internet. At the start of a connection TCP's slow start prevents it from blasting out packets until it's detected the maximum possible speed it can transmit at, and during a connection TCP actively watches for signs of congestion. The smooth running of the Internet as a whole relies on protocols like TCP being able to detect congestion and slow down. If not there'd likely be a <a href="http://en.wikipedia.org/wiki/Congestive_collapse#Congestive_collapse">congestion collapse</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5VrcDARG9qzMgNjzXE0bsS/b37ca6778d6044db491d102e60667c4a/7454479488_9cf64433d6.jpeg.scaled500.jpg" />
            
            </figure><p>Image credit: <a href="http://www.parliamentlive.tv/Main/Player.aspx?meetingId=10948&amp;wfs=true">joiseyshowaa</a></p><p>TCP spots congestion by watching for lost packets. On the wired Internet lost packets are a sign of congestion: they're a sign that a buffer in a router or server somewhere along the route packets are taking is full and is simply dropping packets. When lost packets are detected by TCP it slows down.</p><p>That all falls apart on mobile networks because packets get lost for other reasons: you move around your house while surfing a web page, or you're on the train, or you just block the signal some other way. When that happens it's not congestion, but TCP thinks it is, and reacts by slowing down the connection.</p><p>It seems like it might be a simple matter to change the congestion avoidance algorithm in TCP to take into account the challenges of mobile networks, but it's actually an area of <a href="http://en.wikipedia.org/wiki/TCP_congestion_avoidance_algorithm">active research</a> with many different possible replacements for the existing basic algorithm. It's hard because trying to balance maximizing throughput, preventing congestion on the Internet, dealing with actual congestion, and spotting phony congestion is complex.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Pbjdr8LCoKszcWmPWU6uF/4da4d491fb6c86da01303f01390fa0c1/6031969871_19086b6f70.jpeg.scaled500.jpg" />
            
            </figure><p>Image credit: <a href="http://www.flickr.com/photos/mikecogh/">mikecogh</a></p><p>And if that weren't enough mobile networks also introduce another tricky problem: packet reordering. Although TCP is designed to cope with reordering of packets (because they might have followed different routes between source and destination) large reordering can occur in mobile networks when a mobile phone is handed off from one tower to the next.</p><p>For example, a stream of packets being transmitted by a moving mobile user (perhaps sending a large email) might be split with some going down one route through one tower and the rest through a different tower and by a different route.</p><p>This causes problems for some of the newer congestion avoidance algorithms (such as <a href="http://en.wikipedia.org/wiki/TCP_congestion_avoidance_algorithm#TCP_New_Reno">TCP New Reno</a>) and can cause additional slow downs.</p><p>CloudFlare helps solve these problems for our customers in two ways. Firstly, we customize the parameters inside the TCP stacks in our web servers to tune for the best possible performance and secondly we actively monitor and classify the connections from people surfing our customers' sites.</p><p>By classifying connections we are able to dynamically determine the best way to behave on a connection. We know whether this is likely to be a high-latency mobile phone browsing session, or a high-bandwidth broadband connection in someone's home or office. Doing that allows us to give the best performance to end users, and ensure that customers' web sites are snappy wherever and however they are accessed.</p><p>And we continually look at ways of improving network performance for our customers by tuning TCP, monitoring performance, opening new data centers and introducing features like <a href="/combining-javascript-css-a-better-way">Rocket Loader</a>, <a href="/introducing-mirage-intelligent-image-loading">Mirage</a>, <a href="/introducing-polish-automatic-image-optimizati">Polish,</a> <a href="/what-makes-spdy-speedy">SPDY</a>, and <a href="https://www.cloudflare.com/railgun">Railgun</a>.</p> ]]></content:encoded>
            <category><![CDATA[Mobile]]></category>
            <category><![CDATA[TCP]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Mirage]]></category>
            <category><![CDATA[Cloudflare Polish]]></category>
            <category><![CDATA[spdy]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">1MVrMDyoyJFXjugBzfD5Zg</guid>
            <dc:creator>John Graham-Cumming</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing SPDY]]></title>
            <link>https://blog.cloudflare.com/introducing-spdy/</link>
            <pubDate>Fri, 15 Jun 2012 09:43:00 GMT</pubDate>
            <description><![CDATA[ In 2009, Google began work on a new network protocol to make web pages faster. Dubbed SPDY (pronounced "speedy"), the protocol is designed to solve many of the bottlenecks that slow HTTP down. Beginning today, we're rolling out a beta of SPDY to CloudFlare customers.  ]]></description>
            <content:encoded><![CDATA[ <p><i>We want to acknowledge and thank the amazing team of engineers at NGINX. They have been working on a SPDY implementation for quite some time and their work made it possible for us to roll out SPDY across our network. CloudFlare's core is built on top of the NGINX platform and we recommend it highly for anyone looking for a fast, secure, scalable web server. You can read more about their SPDY extension on their </i><a href="http://mailman.nginx.org/pipermail/nginx/2012-June/034233.html"><i>mailing list</i></a><i>.</i></p><hr /><p>In 2009, Google began work on a new network protocol to make web pages faster. Dubbed SPDY (pronounced "speedy"), the protocol is designed to solve many of the bottlenecks that slow HTTP down. Beginning today, we're rolling out a beta of SPDY to CloudFlare customers. Read this post and then, if you're interested in participating in the beta, <a href="https://www.cloudflare.com/spdy">complete the beta application form</a>.</p>
    <div>
      <h3>How SPDY Makes Things Speedy</h3>
      <a href="#how-spdy-makes-things-speedy">
        
      </a>
    </div>
    <p>Standard HTTP needs to make a new TCP request for all the objects on the page, Because there is significant overhead for each new TCP connection, all these connections slow down performance significantly. SPDY's biggest win comes from what is known as connection multiplexing. This means that mutiple objects from a particular site are requested and retrieved from a single request. Less connection overhead means faster page loads.</p><p>HTTP also requests objects in a particular order and one slow resource can block the loading of other resources. SPDY allows the browser to query for multiple objects in one request and for the objects to be sent down the wire as they are ready and out of order. Again, this can increase performance by not holding up the delivery of objects that are available quickly because some take longer to request.</p><p>SPDY includes some other performance wins as well. It allows HTTP headers to be compressed, which isn't possible with standard HTTP connections. The compression algorithm uses a HTTP-aware dictionary, which means common strings that appear in headers don't need to be sent across the network. Every byte you don't need to send not only reduces bandwidth use but, more importantly, increases web performance.</p>
    <div>
      <h3>SPDY Caveats</h3>
      <a href="#spdy-caveats">
        
      </a>
    </div>
    <p>While there is a lot of excitement around SPDY, there are some caveats. The first is that only certain browsers support the protocol. Google's Chrome and the latest release of Firefox (version 11+) contain SPDY support. While the Internet Engineering Task Force (IETF) is considering SPDY as an official Internet protocol, it has not yet been adopted so it's not clear whether there will be additional support from browsers such as Microsoft's Internet Explorer and Apple's Safari.</p><p>SPDY is built on top of TLS, which means it requires a site to have a valid <a href="https://www.cloudflare.com/application-services/products/ssl/">SSL certificate</a> in order to work. This, unfortunately, limits SPDY only to CloudFlare's paid customers who have enabled Flexible or Full SSL support. Microsoft is working on revised IETF proposal that is SPDY-like, but removes the requirement for SSL/TLS. If the TLS requirement is removed in the future, we'll make SPDY (or whatever it comes to be called) available more broadly.</p><p>Very few sites currently support SPDY (Google's sites and Twitter being the most notable to support the protocol). As a result, there haven't been a significant number of real world case studies. A recent article by an Akamai researcher pointed out that for much of the web <a href="http://www.guypo.com/technical/not-as-spdy-as-you-thought/">SPDY's performance wins will be limited</a>. We've confirmed similar findings in our tests. The primary reason for this caveat is that most sites are a collection of objects from multiple sources. Since SPDY's multiplexing only works on a per-domain basis, if a site has objects pulled from multiple sources then even if all those sources support SPDY connections still won't be able to be multiplexed between them.</p><p>Finally, SPDY is complicated to setup for a lot of sites. Support on most web servers is nascent and unproven. Because of this, sites have been hesitant to setup SPDY support themselves.</p>
    <div>
      <h3>How CloudFlare Makes SPDY Even Speedier</h3>
      <a href="#how-cloudflare-makes-spdy-even-speedier">
        
      </a>
    </div>
    <p>The good news is CloudFlare is making SPDY extremely easy and features like Rocket Loader remove some of the biggest SPDY caveats, making the protocol even speedier. For SPDY support, CloudFlare acts as a gateway. Similar to how CloudFlare's Automatic IPv6 Gateway works, an origin server doesn't need to support SPDY. Instead, visitors with browsers that support SPDY connect to CloudFlare over the protocol. We handle the multiplexing and begin sending down objects we already have in our cache. The request to the origin server for non-cached objects is sent over standard HTTP/S. As a result, CloudFlare customers can implement SPDY support with a single click.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2IlJHp4Rg949qPVHmFIS7Y/e87bd484784cec7e7f18a70e02b673ab/rocket_loader_diagram.png.scaled500.png" />
            
            </figure><p>CloudFlare's Rocket Loader also helps with <a href="/how-cloudflare-rocket-loader-redefines-the-modern-cdn/">some of the multiplexing limitations</a>. Rocket Loader was built to provide multiplex-like support over a standard HTTP connection. By gathering all scripts, regardless of where they're hosted, into a single HTTP request, Rocket Loader limits the number of HTTP connections that are needed. This also means that even third party scripts that appear on your page are requested under your site's domain. As a result, if you enable SPDY and Rocket Loader together then you will be able to get the benefits of multiplexing even for many of the object that make up your site even if they are hosted outside of your domain.</p>
    <div>
      <h3>Beta Rollout</h3>
      <a href="#beta-rollout">
        
      </a>
    </div>
    <p>CloudFlare is rolling out the SPDY beta to select customers over the coming weeks. To be eligible for the beta, you need to have SSL enabled which requires one of CloudFlare's <a href="http://cloudflare.com/plans">paid plans</a>. As mentioned above, this is a limitation of the protocol and if that limitation is removed in the future then we'll plan on rolling out SPDY support more broadly. If you're interested in trying it, <a href="https://www.cloudflare.com/spdy">complete the beta application form</a> and we'll send you an invitation as space is available.</p><p>At CloudFlare, we're committed to making the web speedier in every way we can. We're excited to offer the first easy way for websites that want to support SPDY to be able to do so easily and in a way that will get the most out of the protocol.</p> ]]></content:encoded>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[spdy]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">31V0OVzMkKUgaUpMxkdPQZ</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[CloudFlare Tips: Recommended steps after activating through a partner]]></title>
            <link>https://blog.cloudflare.com/cloudflare-tips-recommended-steps-after-activ/</link>
            <pubDate>Mon, 16 Apr 2012 19:04:00 GMT</pubDate>
            <description><![CDATA[ CloudFlare has partnered with a number of CloudFlare Certified Partners to make it simple for website owners that want a faster and safer website.  ]]></description>
            <content:encoded><![CDATA[ <p></p><p>CloudFlare has partnered with a number of <a href="https://www.cloudflare.com/hosting-partners">CloudFlare Certified Partners</a> to make it simple for website owners that want a <a href="https://www.cloudflare.com/features-cdn">faster</a> and <a href="https://www.cloudflare.com/features-security">safer</a> website. Since signing up for CloudFlare through a hosting partner is different than signing up for CloudFlare directly, we wanted to provide some quick tips to help you get the most out of your CloudFlare experience.</p>
    <div>
      <h3>Things you should know about right away</h3>
      <a href="#things-you-should-know-about-right-away">
        
      </a>
    </div>
    <ol><li><p>You do not need to change your name servers when activating through a hosting partner. You would still manage your DNS entries at your hosting provider or registrar.</p></li><li><p>CloudFlare can only be enabled for CNAME records when activating through a hosting partner. To enable CloudFlare on your root domain (yourdomain.com), which is an A record, you need to have your hosting partner set a <a href="http://cloudflare.tenderapp.com/kb/adding-sites-cloudflare/how-do-i-handle-a-301-redirect">301 redirect</a> from your root domain to <a href="http://www">www</a>. Not only will the redirect help accelerate and protect the root domain, this will also make the statistics in your CloudFlare account accurate. Note: If you have a naked domain, 'yourdomain.com', and you don't want your visitors to go to '<a href="http://www.yourdomain.com">www.yourdomain.com</a>', then you need to <a href="https://www.cloudflare.com/sign-up-new">signup directly with CloudFlare</a>.</p></li><li><p>What you should do if you see any of the following error messages after enabling CloudFlare:</p></li></ol><p>"Host Not Configured to Serve Web Traffic" error message will appear on the first request to your site after activating through a partner, then will go away after a few minutes. If it lasts for more than 10 minutes,then contact your hosting provider and our support teams will work together to resolve.</p><p>"<a href="https://support.cloudflare.com/entries/22052913-why-am-i-getting-a-gateway-error">CloudFlare-nginx 502 Bad Gateway</a>": This is an issue on the CloudFlare network. We deal with these quickly (less than 10 minutes). We publish all announcements regarding our network status on <a href="https://twitter.com/#!/CloudFlareSys">@CloudFlareSys</a>.</p><p>"<a href="https://support.cloudflare.com/entries/22036452-my-website-is-offline-or-unavailable">Website is Unavailable</a>": Either your server is offline and we don't have a copy of your site in cache <i><b>or</b></i> something on the origin server is blocking <a href="https://www.cloudflare.com/ips">CloudFlare's IPs</a>.</p><p>If your server is online, then work with your hosting provider to find out what could be blocking CloudFlare's IPs on your server. The most common culprit is a security solution like a firewall like CSF or IP tables. As soon as the block is removed, the error page will disappear.</p>
    <div>
      <h3>Key CloudFlare features</h3>
      <a href="#key-cloudflare-features">
        
      </a>
    </div>
    <p><i><b>SSL</b></i>If you have SSL on the domain(s), you will need to upgrade to a <a href="https://www.cloudflare.com/plans">Pro account</a>. The cost for a Pro account is $20.00 per month for the first website and $5.00 for each additional site. In addition to the SSL support, you will also receive additional <a href="https://www.cloudflare.com/plans">security and performance</a> benefits.</p><p>Note: You will find the option to upgrade to Pro in your CloudFlare account.</p><p><i><b>Development Mode</b></i>If you are making changes to the <a href="https://support.cloudflare.com/entries/22037282-what-file-extensions-does-cloudflare-cache-for-static-content">static content</a> on your website, temporarily bypass CloudFlare's cache so any changes appear immediately. You can find Development Mode either right in your hosting provider's control panel or by logging in to your CloudFlare account under CloudFlare Settings.</p><p><i><b>PageRules</b></i>PageRules gives you more powerful performance and configuration options, including:<a href="/introducing-pagerules-advanced-caching">Advanced Caching Configurations</a><a href="/introducing-pagerules-fine-grained-feature-co">Excluding URLS from CloudFlare's default caching and security options</a><a href="/introducing-pagerules-url-forwarding">Setting URL forwards and redirects</a></p>
    <div>
      <h3>Recommended (Free!) Optional CloudFlare Features</h3>
      <a href="#recommended-free-optional-cloudflare-features">
        
      </a>
    </div>
    <p>CloudFlare has developed web content optimization features called <a href="/we-have-lift-off-rocket-loader-ga-is-mobile/">Rocket Loader</a> and <a href="/an-all-new-and-improved-autominify">Auto Minify</a>. Both Rocket Loader and Auto Minify are designed to load your site's resources even faster than the default CloudFlare configuration.</p><p><i><b>Rocket Loader</b></i>Rocket Loader will speed up the delivery of your pages by automatically asynchronously loading your JavaScript resources. Rocket Loader works well for websites that have a lot of ads, widgets or plugins.</p><p><i><b>Auto Minify</b></i>Removes all unnecessary characters from HTML, <a href="https://www.cloudflare.com/learning/performance/how-to-minify-css/">CSS</a>, and JavaScript to reduce file size.</p><p>Note: Both of these features are still in beta. If you encounter any issues, such as a broken plugin or JavaScript not working properly, then please turn the feature off and <a href="https://www.cloudflare.com/wco-bug-report.html">report any bugs</a> to our team.</p><p>To turn on Rocket Loader and Auto Minify, you need to log in to your CloudFlare account and go to CloudFlare Settings.</p><p><i><b>IPv6 Gateway</b></i>Make your website IPv6 compatible, by turning on the CloudFlare IPv6 gateway.</p>
    <div>
      <h3>Where you can find out more about CloudFlare</h3>
      <a href="#where-you-can-find-out-more-about-cloudflare">
        
      </a>
    </div>
    <p>The <a href="http://support.cloudflare.com/">CloudFlare Support Center</a> has answers to a number of questions. Searching our knowledge base is the fastest way to get a quick response to the majority of questions. Don't see the answer to your question? Please <a href="http://support.cloudflare.com/">contact CloudFlare</a>.</p>
    <div>
      <h3>Updates and Giveways</h3>
      <a href="#updates-and-giveways">
        
      </a>
    </div>
    <p>We frequently post about product updates, early beta access to new features, system issues, and giveaways, so we recommend that you follow us on Facebook, Twitter or Google+:</p><ul><li><p><a href="https://www.facebook.com/CloudFlare">Facebook</a></p></li><li><p><a href="http://twitter.com/cloudflare">Twitter</a></p></li><li><p><a href="https://plus.google.com/100611700350554803650/">Google+</a></p></li></ul><p>Thank you for joining CloudFlare in <a href="https://www.cloudflare.com/cloudflare-partners-self-serve-program-open-beta/">partnership with your hosting provider.</a></p> ]]></content:encoded>
            <category><![CDATA[Onboarding]]></category>
            <category><![CDATA[Best Practices]]></category>
            <category><![CDATA[IPv6]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">2tnfWSXGjuZr9P0JsFjMWu</guid>
            <dc:creator>Damon Billian</dc:creator>
        </item>
        <item>
            <title><![CDATA[Combining Javascript & CSS, a Better Way]]></title>
            <link>https://blog.cloudflare.com/combining-javascript-css-a-better-way/</link>
            <pubDate>Mon, 03 Oct 2011 02:30:00 GMT</pubDate>
            <description><![CDATA[ The conventional wisdom in web performance circles is that you want to combine multiple javascript and CSS files. The reason for this is that there is significant overhead every time you setup a new HTTP request. More requests, more wasted overhead. ]]></description>
            <content:encoded><![CDATA[ <p>The conventional wisdom in web performance circles is that you want to <a href="http://developer.yahoo.com/performance/rules.html#num_http">combine multiple javascript and CSS files</a>. The reason for this is that there is significant overhead every time you setup a new HTTP request. More requests, more wasted overhead.</p>
    <div>
      <h3>Why Minimize HTTP Requests?</h3>
      <a href="#why-minimize-http-requests">
        
      </a>
    </div>
    <p>This problem is magnified on mobile devices. Your smart phone can stream video from YouTube without stuttering, because it is a single HTTP connection, but it often falters on seemingly simple web pages, because they are made up of a number of separate objects that need to all be loaded through their own HTTP requests. Mobile networks have reasonable bandwidth once a connection is established, but each new connection has a probability of failing that can block page loading.</p><p>Combining Javascript and CSS seems like a sensible solution, but it runs into multiple problems:</p><ul><li><p>Combined Javascript or CSS can clobber the namespace of other scripts and create unpredictable bugs.</p></li><li><p>Combined Javascript or CSS can become large and unwieldy with all code that is needed site-wide leading to a slow initial-load time.</p></li><li><p>One change to any part of the combined Javascript and CSS file invalidates the whole file in the browser's cache and requires a slow re-download.</p></li><li><p>Combined files can lose the benefits of cross-site Javascript CDNs (like <a href="http://www.cdnjs.com">CDNJS.com</a>) which effectively pre-load common scripts into the visitor's cache before they arrive at your site.</p></li><li><p>It can be difficult or impossible to combine third party scripts like those used for things like Google AdSense, Facebook's Like Button, or the Twitter Follow Button.</p></li></ul><p>At CloudFlare, we decided that while the goal of reducing the number of HTTP requests was important for improving web performance, there had to be a better way than naively concatenating Javascript and CSS.</p>
    <div>
      <h3>Introducing Rocket Loader</h3>
      <a href="#introducing-rocket-loader">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/hGovYyUe1XvRhKG3lJyu6/d649322e1799bf2840699ad383146bff/optimizer-rocket-loader.png.scaled500.png" />
            
            </figure><p>CloudFlare's approach to reducing HTTP requests is revolutionary. Dubbed "Rocket Loader," the system automatically detects tags that would require a new HTTP request. Instead of combining the files and leading to the issues above, Rocket Loader instead focuses on combining what really matters for performance: requests.</p><p>Just as YouTube opens a single HTTP connection and then streams down the video, Rocket Loader opens a single HTTP connection to CloudFlare's network and then streams the individual files through one request. The benefit is that, while there's only one request, the files remain atomic. As a result, unpredictable bugs are avoided, the browser can cache files locally and not re-request them, if one file changes it doesn't invalidate all the sites' other scripts, and it works as well with your own scripts as it does for third party scripts like AdSense and Facebook.</p><p>The net effect is you get the benefits of HTTP request reduction without the downsides of file combination. What does that translate into? Usually another 20% performance benefit on top of what CloudFlare already delivered, and even more for mobile devices.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4gtcHw3GWXWgqdayj2pOD6/dc8fb03d34314c7817af8cfe2c05c9f6/optimizer-asynchronous.png.scaled500.png" />
            
            </figure>
    <div>
      <h3>Manual or Automatic</h3>
      <a href="#manual-or-automatic">
        
      </a>
    </div>
    <p>CloudFlare allows you to have full control over how Rocket Loader is enabled. You can choose Manual mode, in which case you need to mark the scripts you want to be combined on the page. You do this by adding <b>cf-async="true"</b> as the first attribute in the script tag:</p><blockquote><p>\</p></blockquote><p>Alternatively, you can have CloudFlare automatically apply Rocket Loader to all the resources on your page. In this case, if there's one resource that you don't want to be loaded via Rocket Loader, you can exclude it by adding <b>cf-async="false"</b> as the first attribute in the script tag:</p><blockquote><p>\]</p></blockquote>
    <div>
      <h3>Solve the Real Problem</h3>
      <a href="#solve-the-real-problem">
        
      </a>
    </div>
    <p>Rocket Loader is a great example of technology that CloudFlare has developed to solve a real problem the right way rather than sheepishly following the conventional wisdom. Rocket Loader leverages CloudFlare's <a href="https://www.cloudflare.com/learning/cdn/what-is-a-cdn/">global CDN platform</a> in order to get the best possible performance for our users. We have big plans on how to expand Rocket Loader and help reduce the number of HTTP requests even more. Because it makes such a difference in web performance, we include Rocket Loader for free for every CloudFlare website. You can activate it from your CloudFlare Settings page with a single click, or learn more about <a href="https://www.cloudflare.com/features-optimizer.html">all the ways CloudFlare can help optimizes your site</a>.</p> ]]></content:encoded>
            <category><![CDATA[JavaScript]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Speed]]></category>
            <guid isPermaLink="false">5YzvYSey8RErJuFtiGX81G</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[How CloudFlare Rocket Loader Redefines the Modern CDN]]></title>
            <link>https://blog.cloudflare.com/how-cloudflare-rocket-loader-redefines-the-modern-cdn/</link>
            <pubDate>Thu, 09 Jun 2011 22:59:00 GMT</pubDate>
            <description><![CDATA[ At CloudFlare, we built our own CDN from the ground up. We used the latest technologies like solid state drives and Anycast routing and geo load balancing to make it as fast and efficient as possible. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>At CloudFlare, we built our own CDN from the ground up. We used the latest technologies like solid state drives for screaming I/O and Anycast routing and geo load balancing to make it as fast and efficient as possible. But we didn't want our efforts to make the web faster to stop with the traditional CDN. There were two core problems we wanted to address. The first was that a website can no longer be thought of as served from a single web server in a single location. Websites are collections of multiple apps, widgets, and tags that include everything from the ad network code inserted on a page to include advertising to the Facebook Like button.</p><p>Anyone surfing the web has noticed the alert in the lower-left of your browser that says: "Waiting for _________ to load." In the past, if any one of these third party apps was slow to load, no matter what you did to improve your own site's performance, they could drag you down. While this lag is annoying on desktops, it's nearly impossible on a mobile device. Think of it this way: each one of those connections to another third party service is another opportunity for your mobile phone provider to screw up.</p><p>The second problem was that any script on a web page could potentially block it from rendering. The way browsers work, whenever a piece of script is encountered by default the browser needs to stop and wait for it to render before it can finish drawing the page. Again, we've all seen this: a site that the top part of the page loads, then it hangs while it waits for an ad, then the rest of the page fills in.</p><p>Compare that with how some of the Internet Giant's sites load. Facebook, for example, renders the page extremely quickly with the initial content you can see, then fires the scripts necessary to load in ads and make the pages interactive. The experience is not just a site that loads faster, but one that feels much snappier. And, again, with their more limited memory and CPU, the lag created by processing scripts is only amplified on mobile devices.</p><p>At CloudFlare, our team has spent the last year figuring out how we could leverage our technology to <a href="https://www.cloudflare.com/learning/cdn/common-cdn-issues/">address both these issues</a>. The first step in this is what we call Rocket Loader™. Rocket Loader does a bunch of things:</p><ol><li><p>It ensures that all the scripts on your page will not block the content of your page from loading;</p></li><li><p>Loads all the scripts on your page, including third party scripts, asynchronously;</p></li><li><p>Bundles all the script requests into a single request over which multiple responses can be streamed;</p></li><li><p>Uses LocalStorage on most browsers and nearly all smart phones to more intelligently store scripts so they aren't refetched unless necessary.</p></li></ol><p>At a high level, here's a diagram that outlines a way to think about it.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/CX9nZWG8T9M0yRyZdPfks/ef7f68eee37eab16f52452e2baf816e7/rocket_loader_diagram.png.scaled500.png" />
            
            </figure><p>CloudFlare adds two layers of cache for third party scripts that don't change often. First, we can store the scripts on our global CDN, so they are close to all your visitors and get the benefits of our extensive network (and an already-open HTTP connection). Second, on most modern browsers and smartphones, we use the browser's LocalStorage cache to intelligently store the resources that the site needs in order to avoid round trips to the server. Here's the Firebug waterfall chart of two pages loading before/after Rocket Loader is applied:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7J3XtLTx00KNP6Tz4M1m5r/51a9d0a3142b18d7f3665ec4073ef034/before_after_HAR.png.scaled500.png" />
            
            </figure><p>Google has done great work in this space, creating a protocol called <a href="http://en.wikipedia.org/wiki/SPDY">SPDY</a>. It is great, does many of the same performance optimizations and some others as well, but unfortunately only works with the Chrome browser. Rocket Loader will bring many of the same performance benefits promised by SPDY, but works on most browsers and all smart phones, whether your visitors are surfing your site from an iPhone, Android, or Windows device.</p><p>What's also really cool about this is, unlike some other companies that have done limited work in the space, CloudFlare doesn't need to cache your content in order to make these improvements. We modify the HTML on-the fly as it passes through our network, without slowing down page delivery. This means that CloudFlare can improve the performance of even highly dynamic websites without forcing you to flush your cache every time there's an update to your pages.</p><p>Want to see it in action? Check out the performance of the Financial Times site loaded side-by-side in a Firefox browser.</p><p>Despite the fact that FT is using one of the top-tier CDNs, Rocket Loader is able to double the site's performance. We don't mean to pick on the Financial Times: I personally love their content. While the improvement here is dramatic, we saw similar benefits across most major media sites despite heavy CDN usage.</p><p>People ask us all the time if CloudFlare is a CDN, and the answer at some level is yes. We run a globally distributed, load-balanced network that caches static content closer to the visitor. But, really, we've built something that's much more. We've taken the lessons learned from the last 15 years of CDNs, improved on those, and then applied many new technologies that take web performance to an entirely new level. You can <a href="http://cdata.github.com/presentations/what-else-is-cloudflare/">learn more from a presentation</a> Chris and Jason from our engineering team recently gave on the technology behind Rocket Loader.</p><p>Rocket Loader doesn't cost us anything more to deploy, and we believe everyone should have access to a fast site, so we include it in all of our plans: even the free one. Give it a try with one click from your CloudFlare settings page. If you find any pages with bugs, let us know through our <a href="https://www.cloudflare.com/wco-bug-report.html">special bug reporting page for the feature</a>. This is a radical new approach to web performance, and we're pushing updates daily to make it better and better.</p> ]]></content:encoded>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <category><![CDATA[spdy]]></category>
            <guid isPermaLink="false">10oUw70bxV27RyVMSfoJBD</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
        <item>
            <title><![CDATA[Watch as CloudFlare Announces CloudFlare Apps and Rocket Loader to the World]]></title>
            <link>https://blog.cloudflare.com/watch-as-cloudflare-announces-cloudflare-apps/</link>
            <pubDate>Thu, 26 May 2011 19:28:00 GMT</pubDate>
            <description><![CDATA[ 


Yesterday our CEO and co-founder, Matthew Prince, dropped in on
TechCrunch Disrupt in NYC to give an update on CloudFlare and to make a
few announcements. CloudFlare couldn't have been more excited to
present at TechCrunch Disrupt and debut our CloudFlare Apps and Rocket
Loader services. You can tell by watching Matthew's
presentation that we've been
busy.


We've also received some great media clips, including articles from
TechCrunch
and Robert Scoble - complete with a video of Matthew and  ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/KNdbIVtlijtGbbylelVjN/4682aeaa71647c76957d577649c48237/tcdisrupt_web-001-1413.jpg.scaled500.jpg" />
            
            </figure><p>Yesterday our CEO and co-founder, Matthew Prince, dropped in on TechCrunch Disrupt in NYC to give an update on CloudFlare and to make a few announcements. CloudFlare couldn't have been more excited to present at TechCrunch Disrupt and debut our CloudFlare Apps and Rocket Loader services. You can tell by watching <a href="http://www.ustream.tv/recorded/14950364">Matthew's presentation</a> that we've been busy.</p><p>We've also received some great media clips, including articles from <a href="http://techcrunch.com/2011/05/25/with-3-5-billion-page-views-a-month-cloudflares-speed-and-security-hit-your-apps/%20">TechCrunch</a> and <a href="http://www.businessinsider.com/first-look-cloudflare-apps-make-web-applications-faster-and-safer-dramatically-so-in-some-cases-2011-5">Robert Scoble - complete with a video of Matthew and Michelle explaining CloudFlare Apps and Rocket Loader.</a><a href="http://www.businessinsider.com/first-look-cloudflare-apps-make-web-applications-faster-and-safer-dramatically-so-in-some-cases-2011-5"></a></p><p>Thanks to all our customers for the tweets, likes, comments, and overall CloudFlare love you've been spreading.</p><p>In appreciation of our users, we're sending out CloudFlare t-shirts this week. If you'd like us to send you one, please send us an email to <a>support@cloudflare.com</a> with "t-shirt" in the subject - be sure to include your name, address and shirt size.</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Apps]]></category>
            <category><![CDATA[Rocket Loader]]></category>
            <guid isPermaLink="false">5sBEQguru2Dt1qQljXqGCh</guid>
            <dc:creator>Kristin Tarr</dc:creator>
        </item>
    </channel>
</rss>