var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?aecc9715b0f5d5f7f34fba48a3c511d6"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); fet.setAlias({IMG_URL: "http://img.chinaz.com/"}) var contentid = 602414;
<
>
$.getJSON(APP_URL+'?app=system&controller=content&action=stat&jsoncallback=?&contentid='+contentid); function win() { var w = $(window).width(); var d = 1000; var t = 30; //30为容器宽度1/2 $('.post-prev').css({'left':(w-d)/4-t}); $('.post-next').css({'right':(w-d)/4-t*2}); } window.onresize = function() { win(); } win();
(function() { var s = "_" + Math.random().toString(36).slice(2); document.write('
'); (window.slotbydup=window.slotbydup || []).push({ id: '1080348', container: s, size: '468,60', display: 'inlay-fix' }); })();
您的位置:站长之家首页 > 建站 > 经验 > 正文
(function(){document.write(unescape('%3Cdiv id="bdcs"%3E%3C/div%3E'));var bdcs = document.createElement('script');bdcs.type = 'text/javascript';bdcs.async = true;bdcs.src = 'http://znsv.baidu.com/customer_search/api/js?sid=13215756937974215344' + '&plate_url=' + encodeURIComponent(window.location.href) + '&t=' + Math.ceil(new Date()/3600000);var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(bdcs, s);})();
(function() { var s = "_" + Math.random().toString(36).slice(2); document.write('
'); (window.slotbydup=window.slotbydup || []).push({ id: '2847071', container: s, size: '680,60', display: 'inlay-fix' }); })();
(function() { var s = "_" + Math.random().toString(36).slice(2); document.write('
'); (window.slotbydup=window.slotbydup || []).push({ id: '2847058', container: s, size: '300,60', display: 'inlay-fix' }); })();

【大拿分享】QCON大会MIP(移动网页加速器)全解读

2016-10-28 09:54 来源:站长学院 编辑:cherlee【纠错人评论

A-A+

在由InfoQ主办的QCON技术大会上,百度的高级工程师从技术层面对MIP进行了权威具体的解读,下面让我们共同学习下百度的高工们都讲了什么!

相关阅读:如何快速改造MIP站点?

MIP解读一共分为四部分:

      1、速度对站点的影响

      2、当前移动站点的现状

      3、MIP的原理及配套工具

      4、MIP对应站点的首页

一、速度对站点的影响

众所周知,网站打开速度的快慢,直接决定了用户是否会阅读到网站内容,是否成为留存用户,所以网站打开速度一直是用户体验的一个重要指标!

可以称得上天下武功,唯快不破!

以往研究数据表明网站打开速度对用户浏览、电商成单量、搜索引擎的搜索量等都有很大影响!

如: Facebook每慢500ms用户浏览下降3%,Amazon每增加100ms成单量下降1%,Google每增500ms搜索量下降25%等等;

在百度同样如此,根据最新数据统计显示:在1.5s内每慢500ms,降低3%的用户点击;所以从业界大公司看速度对于产品影响, 可以看出提升性能,对于站点的影响意义重大。

二、当前移动站点的现状

说到打开速度,不得不说移动站点的现状,毕竟移动带宽有限,用户格外看重网站的打开速度。目前从百度点出去的站点,平均页面加载时长5s,页面平均渲染时长3s,亟待提高!

那么如何快速提升移动站点的加载速度呢?毫无疑问,加入MIP项目就可以实现你对速度的渴望!

三、MIP的原理及配套工具

首先介绍下什么是MIP:

MIP (Mobile Instant Pages - 移动网页加速器), 是一套应用于移动网页的开放性技术标准。通过提供MIP-HTML规范、MIP-JS运行环境以及MIP-Cache页面缓存系统,实现移动网页加速。

MIP官网地址:https://www.mipengine.org/

MIP的核心组成:MIP HTML + MIP JS + MIPCache

下面详细讲下MIP各部分的内容

1、MIP规范

代码案例如下:

注:相关网站建设技巧阅读请移步到建站教程频道。

var cpro_id = "u2312054";
  • 0
  • 0
  • 收藏

看过本文的人还看过

document.write(unescape('%3Cdiv id="hm_t_48595"%3E%3C/div%3E%3Cscript charset="utf-8" src="http://crs.baidu.com/t.js?siteId=aecc9715b0f5d5f7f34fba48a3c511d6&planId=48595&async=0&referer=') + encodeURIComponent(document.referrer) + '&title=' + encodeURIComponent(document.title) + '&rnd=' + (+new Date) + unescape('"%3E%3C/script%3E'));
(function(){var c="//cpu.baidu.com";var a=function(){var e=document.createElement("script");e.id="cpu-block-entry";e.src=c+"/js/cb.js";document.head.appendChild(e)};var b=function(g){var h={msg:g.toString()||"no err msg",line:g.lineno||-1};var f=document.createElement("img");f.src=c+"/msg?m=block&e="+encodeURIComponent(JSON.stringify(h))};try{window.feedsbycpu=window.feedsbycpu||[];window.feedsbycpu.push({siteId:'1045726',blockId:'2167',display:"auto"});document.getElementById("cpu-block-entry")||a()}catch(d){b(d)}})();
document.write(unescape('%3Cdiv id="hm_t_59635"%3E%3C/div%3E%3Cscript charset="utf-8" src="http://crs.baidu.com/t.js?siteId=aecc9715b0f5d5f7f34fba48a3c511d6&planId=59635&async=0&referer=') + encodeURIComponent(document.referrer) + '&title=' + encodeURIComponent(document.title) + '&rnd=' + (+new Date) + unescape('"%3E%3C/script%3E'));
var jd_union_unid="350267405",jd_ad_ids="1469:6",jd_union_pid="CPbz65SSKhCN0IKnARoAIKCX5a0BKgA=";var jd_width=640;var jd_height=90;var jd_union_euid=""; var p="ABYOUhlZEAobN1Eaa0pGT1plRB9IXyJDB1oJJV1WWggrCRZGbHszXCh3ZBFTMx0zZnVvfTN%2FDRkOIgVRGF4RCxIPVytZEQMRAFMeWhEyImYnKxB7CiJYEUYGJQIXAlMTUhAGFQZSGVglAw%3D%3D";
(function(){ var appid = 'cy2rgHwBn0Qe', conf = 'prod_07a96b1f61097ccb54be14d6a47439b0'; var doc = document, s = doc.createElement('script'), h = doc.getElementsByTagName('head')[0] || doc.head || doc.documentElement; s.type = 'text/javascript'; s.charset = 'utf-8'; s.src = 'http://assets.changyan.sohu.com/upload/changyan.js?conf='+ conf +'&appid=' + appid; h.insertBefore(s,h.firstChild); window.SCS_NO_IFRAME = true; })()
var cpro_id="u1529699"; (window["cproStyleApi"] = window["cproStyleApi"] || {})[cpro_id]={at:"3",rsi0:"670",rsi1:"230",pat:"1",tn:"baiduCustNativeAD",rss1:"#FFFFFF",conBW:"1",adp:"1",ptt:"0",titFF:"%E5%BE%AE%E8%BD%AF%E9%9B%85%E9%BB%91",titFS:"14",rss2:"#000000",titSU:"0",tft:"0",tlt:"1",ptbg:"90",piw:"0",pih:"0",ptp:"0"}
(function() { var s = "_" + Math.random().toString(36).slice(2); document.write('
'); (window.slotbydup=window.slotbydup || []).push({ id: '2847007', container: s, size: '300,140', display: 'inlay-fix' }); })();
var jd_union_unid="350267405",jd_ad_ids="1329:6",jd_union_pid="CLXr3dmjKhCN0IKnARoAIPyX+rcBKgA=";var jd_width=300;var jd_height=250;var jd_union_euid=""; var p="ABsDUx1cEwAVN1Eaa0pGT1plRB9IXyJDB1oJJV1WWggrEB13cwEqWA91QghUJVJBE2RxWFNIOxkOIgVRGF4RCxIPVytZEQMRAFMeWhEyImYnKxB7CiJYEUYGJQIXA1YcUxYHEABQGl0lAw%3D%3D";
var cpro_id="u2311734"; (window["cproStyleApi"] = window["cproStyleApi"] || {})[cpro_id]={at:"3",rsi0:"300",rsi1:"250",pat:"17",tn:"baiduCustNativeAD",rss1:"#FFFFFF",conBW:"1",adp:"1",ptt:"0",titFF:"%E5%BE%AE%E8%BD%AF%E9%9B%85%E9%BB%91",titFS:"",rss2:"#000000",titSU:"0"}
var cpro_id="u1515570"; (window["cproStyleApi"] = window["cproStyleApi"] || {})[cpro_id]={at:"3",rsi0:"300",rsi1:"300",pat:"1",tn:"baiduCustNativeAD",rss1:"#FFFFFF",conBW:"1",adp:"1",ptt:"0",titFF:"%E5%BE%AE%E8%BD%AF%E9%9B%85%E9%BB%91",titFS:"14",rss2:"#000000",titSU:"0",tft:"0",tlt:"1",ptbg:"90",piw:"0",pih:"0",ptp:"0"}
var cpro_id="u1529681"; (window["cproStyleApi"] = window["cproStyleApi"] || {})[cpro_id]={at:"3",rsi0:"300",rsi1:"380",pat:"6",tn:"baiduCustNativeAD",rss1:"#FFFFFF",conBW:"1",adp:"1",ptt:"0",titFF:"%E5%BE%AE%E8%BD%AF%E9%9B%85%E9%BB%91",titFS:"14",rss2:"#000000",titSU:"0",ptbg:"90",piw:"0",pih:"0",ptp:"0"}
(function(){ var adScript = document.createElement('script'); adScript.src = 'http://img.chinaz.com/js/chinaz.js'; document.getElementsByTagName('head')[0].appendChild(adScript); })();
//文章详细页字体切换 $('.newsTitleBox .tabTxt span').click(function() { var bigSize = 'fz16'; var size = $(this).attr('size'); if( size == bigSize) { $(this).addClass('current').siblings().removeClass('current'); $('.newsMainBox').addClass('fz16'); } else { $(this).addClass('current').siblings().removeClass('current'); $('.newsMainBox').removeClass('fz16'); } return false; }); $(window).scroll(function() { //newFixedBox跟随滚动 var h = $(window).height(); var top = $(window).scrollTop(); var newFixedBox = $('.newFixedBox').prev().offset(); var fixedTop = newFixedBox.top; if(top>=fixedTop+344) { var h1 = parseInt($('#content').children('.main').height()); if(parseInt(top) + 340 < h1){ $('.newFixedBox').css({'position':'fixed','top': 0}); }else{ $('.newFixedBox').css({'position':'absolute','top': h1-510}); } } else { $('.newFixedBox').css({'position':'static', 'top':0}); } /* return true;*/ }); //微信二维码 $('.weixinBar .closeIcon').click(function() { $(this).parent().parent().hide(); }); $('#addError').click(function(){ art.dialog({ width:'800px', height:'500px', id: 'test', title: '文章纠错', content: '

       姓名:

联系邮箱:

文章标题:

纠错内容:

   验证码:

', lock: true, fixed: true, ok: function () { $this = this; if($('#contact').val()==''){ this.shake(); $('#contact').focus(); return false; }else if($('#content').val()==''){ this.shake(); $('#content').focus(); return false; }else if($('#article_seccode').val()==''){ this.shake(); $('#article_seccode').focus(); return false; } $.getJSON('http://app.chinaz.com/?app=contribution&controller=tg&action=add&jsoncallback=?', $("#tg").serialize(), function(data){ if(data.status=='success'){ $this.size('200px',100).content('提交成功,谢谢!').button({ id: 'button', value: '好的', disabled: false }); }else{ $this.size('200px',100).content(data.status).button({ id: 'button', value: '好的', disabled: false }); } } ); $this.size('200px',100).title('请稍等').content('提交中..'); $('.d-button').hide(); return false; }, okValue: '提交', cancelValue: '取消', cancel: function () {} }); return false; }); function holdpic(){//控制内容区域的的图片大小并为过大的图片添加查看原图 var options = { imageLoading:IMG_URL+'js/lib/lightBox/lightbox-ico-loading.gif', imageBtnPrev:IMG_URL+'js/lib/lightBox/lightbox-btn-prev.gif', imageBtnNext:IMG_URL+'js/lib/lightBox/lightbox-btn-next.gif', imageBtnClose:IMG_URL+'js/lib/lightBox/lightbox-btn-close.gif', imageBlank:IMG_URL+'js/lib/lightBox/lightbox-blank.gif', auto_resize:false }; $('#ctrlfscont').find('img').each(function(){ var img = this; if (img.width > 600) { img.style.width = "600px"; img.style.height = "auto"; //$(img).removeAttr('height'); var aTag = document.createElement('a'); aTag.href = img.src; $(aTag).addClass('bPic') .insertAfter(img).append(img) .lightBox(options); } }); $('#fulltext').click(function(){ $('.pagebreak').html(''); $.getJSON(APP_URL+'?app=article&controller=article&action=fulltext&jsoncallback=?&contentid='+contentid,function(data){ context = data.content; $('#ctrlfscont').html(data.content); $('.pagebreak').hide(); holdpic(); }); }) //digg.get(contentid, 'supports'); digg.get(contentid); } $(window).load(function(){ holdpic(); });