On ne remarque pas quand c'est rapide,
mais on ressent quand c'est lent.
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "application/javascript" "application/json" \
"text/css" "text/html" "text/xml" [...]
</IfModule>
</IfModule>
server.modules += ( "mod_compress" )
compress.filetype = ("application/javascript", "application/json", \
"text/css", "text/html", "text/xml", [...] )
gzip on;
gzip_types application/javascript application/json text/css text/html text/xml [...];
main.css
apachesolr_autocomplete.message{font-size:80%;color:#888}.apachesolr_autocomplete.count{float:right}div.apachesolr_autocomplete.suggestion{display:inline;float:left}div.ac_results li{list-style:none;background-image:none!important}
147Ko ⇒ 28Ko ⇒ 21Ko
main.js
apachesolr_ajax={};apachesolr_ajax.finalize=function(settings){pm.maps();$("#tooltip").hide();pm.tooltips();pm.jScrollPane();pm.carousels();pm.datepicker();pm.chooseLanguage();pm.popins();$("#filters-nav li").find(".indicator").hide();$("#overlay").hide();$("#filters-nav li").removeClass("active");$(".item a").hover(function(){$(this).find(".short").addClass("accessibility")},function(){$(this).find(".short").removeClass("accessibility")})};
428Ko ⇒ 128Ko ⇒ 102Ko
index.html
<body class=layout-home><div class=apachesolr_ajax></div><div id=content class=gradient-1><p id=access-keys><a href=#page>Allez au contenu</a> <a href=#nav>Allez à la navigation</a> <a href=#search>Allez à la recherche</a> <a href=#lang lang=en>Change language</a></p></div></body>
50Ko ⇒ 11Ko ⇒ 9.6Ko
Deux headers
Expires: Thu, 04 May 2014 20:00:00 GMT
✘Cache-Control: max-age=3600, must-revalidate
✔Vérification que le client possède la dernière version
Deux couples de headers
Last-Modified: Mon, 04 May 2014 02:28:12 GMT
/ If-Modified-Since
✔ETag: "3e86-410-3596fbbc"
/ If-None-Match
✘There are only two hard things in Computer Science: cache invalidation and naming things.
Nouvelles urls (timestamp, hash, etc)
155Ko
exiftool
Color Space Data : RGB
Profile Date Time : 1998:02:09 06:49:00
Primary Platform : Microsoft Corporation
Device Manufacturer : IEC
Device Attributes : Reflective, Glossy, Positive, Color
Rendering Intent : Perceptual
Connection Space Illuminant : 0.9642 1 0.82491
Profile Creator : HP
Profile Copyright : Copyright (c) 1998 Hewlett-Packard Company
Red Matrix Column : 0.43607 0.22249 0.01392
Green Matrix Column : 0.38515 0.71687 0.09708
Blue Matrix Column : 0.14307 0.06061 0.7141
Device Mfg Desc : IEC http://www.iec.ch
Viewing Cond Illuminant Type : D50
Luminance : 76.03647 80 87.12462
Measurement Flare : 0.999%
Measurement Illuminant : D65
Technology : Cathode Ray Tube Display
Red Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract)
jpegtran -optimize -copy none
155Ko ⇒ 152Ko
152Ko
41Ko
jpegoptim -m80 --strip-all
Secret of Mana
On joue sur background-position en CSS
a {
display:block;
width:15px;
height:15px;
background:url(image.png) 0px 0px no-repeat;
}
a:hover {
background-position:0px -15px;
}
grunt spritely
, Compass, www.spritecow.com
<script>
bloque le parsing</body>
async
sur scripts indépendantsborder: 1px solid transparent
<div id="header">
<h1>Company</h1>
<ul id="menu">
<li><a href="#">AAA</a></li>
<li><a href="#" class="menu-item">BBB</a></li>
</ul>
</div>
<div id="content">
<ul>
<li><a href="#">CCC</a></li>
<li><a href="#">DDD</a></li>
</ul>
</div>
#header h1 { /* Bad key */
font-size:3rem;
}
ul#menu > li { /* overspecify. child ok */
float:left
}
#menu li a { /* Bad key, too broad */
background:red;
}
.menu-item { /* good */
background:green;
}
#content ul * { /* Arrghhhh */
display:block;
}
.menu *
a[href^="http://"]
Un tiens vaut mieux que deux tu l'auras.
startRender
rapideIf at first you don't succeed, blame it on your parents