On ne remarque pas quand c'est rapide,
mais on ressent quand c'est lent.
Bonus : Sprites, JavaScript, CSS, Cookies.
<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_comp_level 6;
gzip_types application/javascript application/json text/css text/html text/xml [...];
En webperf, tout ce que vous avez écrit sera téléchargé et pourra être utilisé contre vous.
.i-btn-1{background:url(../../../../img/themes/aurora/common/buttons.png) 0 -1035px repeat-x;border:1px solid #266099;color:#fff;cursor:pointer;display:inline-block;font-size:13px;font-weight:700;height:24px;line-height:24px;padding:0 10px;text-align:center;text-decoration:none;text-shadow:1px 1px 1px #3c90e3}
buttons.css
15Ko ⇒ 1.6Ko ⇒ 1.1Ko
(function(){var method;var noop=function(){};var methods=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];var length=methods.length;var console=window.console=window.console
common.js
43Ko ⇒ 11Ko ⇒ 7.2Ko
<body><div class=i-body><div class=i-clearer></div><div class=i-nav><div class=i-header-wrapper><div class="i-container i-clearfix"><div class="i-logo i-png"></div><div><div class="i-login-form-default i-login-form-twoline" id=i_login><div class=i-login-form-left><label class="i-label i-member-login" for=txtHandle>Déjà Membre</label>
index.html
64Ko ⇒ 18Ko ⇒ 16Ko
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)
Last-Modified
exiftool
File Size : 494 kB
Image Size : 1920x1265
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
XMP Toolkit : Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27
Original Document ID : xmp.did:999DEC701EB0E311801EFDD03E7C1154
Document ID : xmp.did:6C302F067BD111E4A0FFFBC0293A508B
Instance ID : xmp.iid:6C302F057BD111E4A0FFFBC0293A508B
Creator Tool : Adobe Photoshop CS6 (Windows)
Derived From Instance ID : xmp.iid:25D692D731CB11E4BB03A7E70526CA15
Derived From Document ID : xmp.did:25D692D831CB11E4BB03A7E70526CA15
DCT Encode Version : 100
APP14 Flags 0 : [14], Encoded with Blend=1 downsampling
APP14 Flags 1 : (none)
Color Transform : YCbCr
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:4:4 (1 1)
jpegtran -optimize -copy none
jpegotim -m80 --strip-all
cjpeg-dssim jpegoptim
-m90
, 342Ko, 0.000528
-m80
, 219Ko, 0.001259
-m70
, 172Ko, 0.002076
-m60
, 141Ko, 0.003032
-m50
, 121Ko, 0.003785
-m40
, 104Ko, 0.005191
-m30
, 86Ko, 0.007569
-m20
, 64Ko, 0.013038
-m10
, 38Ko, 0.034276
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>
ul#menu li a { /* Arghhhh */
background:red;
}
#menu li a { /* Bof */
background:red;
}
#menu li > a { /* Mouais, mieux */
background:red;
}
.menu-item { /* Perfect */
background:red;
}
.menu *
a[href^="http://"]
div.fieldgroup {
margin:.5em 0 1em 0;
}
div.fieldgroup .content {
padding-left:1em;/*LTR*/
}
454B
has_js=1;
xtvrn=$499610$;
xtan499610=-;
xtant499610=1;
__utma=132163929.1854756013.1405454567.1405454567.1405454567.1;
__utmb=132163929.1.10.1405454567;
__utmc=132163929;
__utmz=132163929.1405454567.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
249B
static.france.fr 10800 IN CNAME www.france.fr.
ou
static-france.fr 10800 IN CNAME www.france.fr.
domain.com
s'étendent sur *.domain.com
_setDomainName
pour Google Analytics