CloudFlare Rocket Loader

2017年1月11日 | 分类: 【技术】



<script type="text/rocketscript">


<script type="text/javascript">

查了下,通过 的js加速服务 的js 是这样写的。


除了CDN加速外,CloudFlare还使用各种方法对网站进行优化,包括压缩JS、CSS和HTML文件,让JS文件进行异步加载——Rocket Loader™,自动开启Gzip,充分使用现代浏览器的缓存功能,针对不同浏览器、不同终端进行进一步优化,同时CloudFlare也使用了高性能的nginx作为CDN的服务器,最大程度的加快网站访问速度,提高用户访问体验,最重要的是这些优化功能都是一键操作。使用CloudFlare之后Pagespeed的评分蹭到了95,载入网站时也更快了。


CloudFlare’s Rocket Loader system is a general-purpose asynchronous JavaScript loader coupled with a lightweight virtual browser which can safely run any JavaScript code after window.onload.

You can use Rocket Loader by adding the website you would like to enable Rocket Loader on to CloudFlare. CloudFlare automatically adds the code to every page on your website using DNS, no need for you to add it in yourself.

1. Sign up for CloudFlare at . Add your website to CloudFlare using CloudFlare’s easy to use wizard that should appear after you login.
2. Select your site from the list that should appear on your screen. A list may not appear as you have only one site in your account.
3. Select ‘Speed’ in the navigation bar: Navigation bar image
4. Scroll down to Rocket Loader and select the desired option, probably Automatic.
5. Give it a little while to propagate, stuff like this doesn’t happen instantly.