
<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>Mon, 13 Apr 2026 16:55:49 GMT</lastBuildDate>
        <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[Mirage 2.0: Solving the Mobile Browsing Speed Challenge]]></title>
            <link>https://blog.cloudflare.com/mirage2-solving-mobile-speed/</link>
            <pubDate>Thu, 13 Jun 2013 02:00:00 GMT</pubDate>
            <description><![CDATA[ Almost exactly a year ago, CloudFlare announced a feature called Mirage. Mirage was designed to make the loading of images faster in two primary ways. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Almost exactly a year ago, CloudFlare <a href="/introducing-mirage-intelligent-image-loading">announced a feature called Mirage</a>. Mirage was designed to make the loading of images faster in two primary ways: 1) deliver smaller images for devices with smaller screens; and 2) "lazy load" images only when they appeared in the viewport. Both of these optimizations were designed primarily to accelerate web performance on mobile devices.</p><p>Mobile devices present a number of challenges to delivering fast web performance. Because they rely on radio networks, the bandwidth to a mobile phone or tablet is often slow. However, the problem isn't limited to just slow bandwidth. Mobile connections are much more likely to experience "loss." To optimize for mobile performance you need to prioritize the most important data and download it first and you need to minimize the number of individual connections in order to limit the impact of packet loss.</p><p>The first version of Mirage was designed to accomplish these goals, but it was relatively naive in the way that it did it. We would store multiple versions of images, which make up the bulk of the data transferred for most websites, and then attempt to deliver the one that best matched the screen size. The problem was that the new versions of the images often weren't perfectly matched for the layout of the page or the size of the screen, especially if the page relied on the image's actual dimensions rather than including dimensions in the  tag.</p><p>For the last year, we've studied sites using Mirage and taken what we've learned to refine and improve every aspect of the feature. Today we're excited to announce Mirage 2.0 which is designed from the ground up to solve the mobile browsing speed challenge.</p>
    <div>
      <h3>Virtualized Images</h3>
      <a href="#virtualized-images">
        
      </a>
    </div>
    <p>Mirage 2.0 starts with the idea of image virtualization. When CloudFlare caches an image on our network for a site with Mirage 2.0 enabled, we store two versions. The first version is the full-resolution image, the second is a virtualized image that includes meta data about all the full-resolution image's dimensions but with the image itself is massively reduced in size. The reduced sized version typically as little as 1% the size of the full-resolution image.</p><p>If you enable Mirage 2.0, CloudFlare's network modifies the image tags on your page on the fly so they can be loaded by the Virtualized Image Packager ("VIP"). In parallel with the HTML of your page loading, the Mirage 2.0 VIP begins downloading the virtualized images that appear on the page. The VIP will virtualize images served from your own domain as well as images served from third party domains (e.g., Flickr or Imgur). Because the virtualized images have the full-resolution image's dimensions embedded as meta data, the VIP is able to place the images into the browser's DOM correctly sized so the browser can almost immediately begin the process of rendering the page.</p>
    <div>
      <h3>Minimizing Requests</h3>
      <a href="#minimizing-requests">
        
      </a>
    </div>
    <p>Rather than initiating a new request for each image, the VIP is able to stream all the images from CloudFlare's network with a single request. This uses the same mechanism we created for <a href="/56590463">Rocket Loader, our Javascript performance accelerator</a>. This means that even a page with hundreds of images can begin rendering in the browser with as few as two requests. Even users on slow mobile connections can begin interacting with the page immediately, rather than having to wait for all the full-resolution images to load.</p><p>After the page is rendered with the virtualized images, the VIP begins to replace them with the full-resolution versions. Since the images are already correctly sized for their tags on the page, the browser does not need to reflow the page as the full-resolution versions are loaded. The VIP prioritizes what full-resolution images to load first based on what images are in the browser's viewport. Visually, images appear to "rez" in, starting as low quality and then coming into sharp focus, similar to how a progressive JPEGs load in a browser.</p><p>While you can enable CloudFlare features such as <a href="/introducing-polish-automatic-image-optimizati">Polish in order to optimize your images</a>, by default Mirage 2.0 does not transcode or otherwise alter the original full-resolution images. The VIP will pull third party content directly from the original servers without passing through CloudFlare's network -- unless, of course, the third part is also using CloudFlare.</p>
    <div>
      <h3>Learning Loader</h3>
      <a href="#learning-loader">
        
      </a>
    </div>
    <p>With Mirage 2.0, we've also completely rethought how we detect different browsers and respond to their capabilities. Mirage 2.0 is optimized to be more or less aggressive depending on the capabilities of the browser as well as its connection to the Internet. An iPhone connecting to the web over a wifi network is optimized for different loading priorities than the same device connecting over a cellular network. We even detect the different download speeds of cellular networks from LTE to 3G to Edge and optimize for each connection speed appropriately.</p><p>Mirage 2.0 gathers real browsing intelligence from all its connections which we then use to further optimize the VIP's performance. As more sites enable Mirage 2.0 the CloudFlare's systems automatically begins to optimize for the fastest possible browsing experience from any device on any network. In other words, the same way we use data about security threats in order to protect the sites on our network, we are now using data about real user's browsers around the world in order to ensure everyone on the CloudFlare network has the fastest possible site.</p>
    <div>
      <h3>Reviews Are In</h3>
      <a href="#reviews-are-in">
        
      </a>
    </div>
    <p>We've been testing Mirage 2.0 on some of our most image heavy sites that get significant traffic from mobile browsers. The reaction has been terrific: "As one of the largest image sharing sites in the world, speed has always been really important to us," explained Alan Schaaf, founder and CEO of Imgur. "We've invested a lot of time into getting images to load as fast as possible over mobile networks, especially since we've been developing our mobile app, and we've seen great improvements with Mirage 2.0. We're really happy that CloudFlare continues to launch innovative products to ensure pages on Imgur.com load as fast as possible."</p><p>You can see Mirage 2.0 in action for yourself in the following video:</p>
    <div>
      <h3>Available Now</h3>
      <a href="#available-now">
        
      </a>
    </div>
    <p>Mirage 2.0 is currently in beta and will be made available over the next few weeks to all <a href="http://www.cloudflare.com/plans">paid Cloudflare accounts</a>, including our lowest level PRO accounts which are priced at only $20/month. Mirage 2.0 will fully replace the original version of Mirage in the following months and users with the old Mirage enabled will be upgraded to the newer, better version. Given the importance of mobile browsing, and the massive performance benefit Mirage 2.0 delivers with a single click, we think it is one of the most compelling features we've ever offered. Give it a try and let us know what you think.</p> ]]></content:encoded>
            <category><![CDATA[Mirage]]></category>
            <category><![CDATA[Mobile]]></category>
            <category><![CDATA[Speed]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">QnEnW5Xp0QKWNMZi3jOYn</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 Mirage: Automatic Responsive Web Design via Intelligent Image Loading]]></title>
            <link>https://blog.cloudflare.com/introducing-mirage-intelligent-image-loading/</link>
            <pubDate>Wed, 06 Jun 2012 02:08:00 GMT</pubDate>
            <description><![CDATA[ Yesterday, we announced Polish, which helps to automatically optimize the images on your site and increase performance. Today we're releasing something more ambitious: a system to automatically manage the loading of images in order to maximize your site's performance which we call Mirage. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Yesterday, we <a href="/introducing-polish-automatic-image-optimizati">announced Polish</a>, which helps to automatically optimize the images on your site to decrease their size and thereby increase performance. Today we're releasing something more ambitious: a system to automatically manage the loading of images in order to maximize your site's performance which we call Mirage.</p>
    <div>
      <h3><b>Impact of Images</b></h3>
      <a href="#impact-of-images">
        
      </a>
    </div>
    <p>Images are more than 50% of the data that makes up a typical website. A tool like CloudFlare's Polish substantially reduces the size of images. What would be even better than reducing image sizes would be not loading image data that isn't needed for the page. That's what Mirage does automatically.</p><p>To understand this, imagine a typical blog. A blog is usually a long page with a series of stories, the most recent of which are on top. Your browser window is a certain size, which is known as the viewport. When you load a page, you can only see the images within that window. However, most browsers happily download all the images on the page before the page is ready. This not only slows down page performance, but if you never scroll down the page then it also wastes bandwidth downloading images that will never be seen.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6yy1q1BGBLlwCJgSrVFS3A/7eb7717d24980b9b943217124ee6c18f/inviewport_vs_outofviewport.png.scaled500.png" />
            
            </figure>
    <div>
      <h4><b>Responsive Design: Lazy Loading and Auto Resizing</b></h4>
      <a href="#responsive-design-lazy-loading-and-auto-resizing">
        
      </a>
    </div>
    <p>CloudFlare Mirage is aware of the images on your page, the size of a visitor's viewport, and the type of device and network connection their device has. It then automatically optimizes image loading to only deliver the images that are necessary. Mirage prioritizes the loading of the images that are in the viewport. It then loads the other images as they are needed or as there are spare network resources available. You can see Mirage in action, loading images as a visitor scrolls down the page, in this video.</p><p>In addition to lazy loading, Mirage can also automatically optimize images to the size and resolution that is best for the page and device. One of the biggest wastes on the web is that people will upload a large image and then resize it down to a thumbnail or smaller size within HTML. Mirage detects cases like this and instructs the CloudFlare CDN to do the image resizing at the server. This means that if have a 1000px x 1000px image that you're only displaying at 100px x 100px then we deliver it to your visitors at the appropriate size and without wasting unnecessary bandwidth.</p>
    <div>
      <h3><b>Mobile, Mobile, Mobile, Mobile, Mobile</b></h3>
      <a href="#mobile-mobile-mobile-mobile-mobile">
        
      </a>
    </div>
    <p>Mirage significantly improves mobile performance in multiple ways. It automatically detects if a visitor is connecting over a mobile operator's network (where bandwidth is limited) or over a wifi conncetion (where bandwidth is less of a concern) and adjusts its image loading algorithm appropriately. So, for example, it will only load images as a visitor scrolls them into the viewport if you're on a 3G connection, where it will lazy load the all images in the background, prioritized based on where they appear on the page, if you're on wifi.</p><p>Mirage's dynamic sizing also takes into account the size of the viewport on a mobile device. A background image that is 2,000 pixels wide is wasted on an iPhone visitor's screen that is only 960-by-640-pixels. Mirage can automatically downsize the image so that you're never delivering more pixels than the device in question can display. Less data delivered to a mobile device not only improves a site's performance, but also helps your visitors with limited data plans not saturate their caps.</p>
    <div>
      <h3><b>Automatic Responsive Web Design</b></h3>
      <a href="#automatic-responsive-web-design">
        
      </a>
    </div>
    <p>Responsive web design is the principle that your site's layout should respond to the environment. Usually this requires significant code changes to your underlying site, which many existing sites have difficulty retrofitting into their current stack. CloudFlare's Mirage automatically enables some of the biggest wins from responsive web design without you having to change a single line of HTML.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/nv1wsBGzFDEubxFsFTKsU/0ae7ac4944cc44f6fc113d4a0120a9e0/mirage_ui.png.scaled500.png" />
            
            </figure><p>You can pick the particular Mirage features you want to enable and they will be applied across your site. Mirage works via Javascript, but has a safe fallback for visitors with Javascript disabled. Since Mirage adds additional resource load to our network in terms of additional storage and CPU usage, we're limiting the feature to <a href="https://www.cloudflare.com/plans">paid customers</a>. You can turn on Mirage from the Performance tab of your CloudFlare Settings. Together, Polish and Mirage make a one-two punch that ensures your site is handling images in the best possible way for each visitor to your site.</p> ]]></content:encoded>
            <category><![CDATA[Mirage]]></category>
            <category><![CDATA[Mobile]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Cloudflare Polish]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">2BDLorQZlKej8uCpeJkEng</guid>
            <dc:creator>Matthew Prince</dc:creator>
        </item>
    </channel>
</rss>