exstatic -- browser cache
TRANSCRIPT
EXSTATIC[example.org’s statics]
GET /Host: example.org
Caching headers
Last-Modified
http://weka.com/iscool
200 OKContent-Type: image/pngLast-Modified: Wed, 22 Feb 2006 04:15:54 GMT
http://weka.com/iscool
GET /foo.pngHost: example.orgIf-Modified-Since: Wed, 22 Feb 2006 04:15:54 GMT
Last-Modifiedallows you to perform
validity checkagainst cache’s resources
—and download only outdated resources
Expires
http://weka.com/iscool
200 OKContent-Type: image/pngExpires: Wed, 30 Mar 2012 19:16:20 GMT
Expiresno request
since it’s cached!or unless explicitly asked (refresh)
Set caching headers aggressively for all static resources.
— google pagespeed
<FilesMatch "\.(gif|jpg|js|css)$"> ExpiresDefault "access plus 1 year"</FilesMatch>
Caching headersTake advantage on client’s
caching mechanism—
and reduce requests
Revving
v2
The most effective solution is to change any links to them; that way, completely new representations will be loaded fresh from the origin server.
— Mark Nottingham
The most effective solution is to change any links to them; that way, completely new representations will be loaded fresh from the origin server.
— Mark Nottingham
trick
http://weka.com/iscool
200 OKContent-Type: image/pngLast-Modified: Thu, 26 Feb 2006 05:19:12 GMT
vX =
foo-{md5}.png
GET /foo-234569103.pngHost: example.org
RewriteEngine onRewriteRule (.*)(-[0-9]+)?(\.[^\.]*)$ $1$3 [L]
http://weka.com/iscool
200 OKContent-Type: image/pngLast-Modified: Thu, 26 Feb 2006 05:19:12 GMT
Revvingeffective brower’s trick to
bypass caching—
or make sure your user has the latest version
Cookieless domain
Cookieless domainMinimize requests!
—but maybe not in the “critical path”
Parallelize downloads
X concurrent connexions maxper hostname
host1 host2 host3 host4
Parallelize downloadsBypass browsers’
concurrent connexions limitation
Infra?
web1 web2 web3 assets
tagA tagA tagA tagA
tagA
tagB tagB tagB tagB
example.org
one.exstatic.orgtwo.exstatic.orgthree.exstatic.orgfour.exstatic.org
exstatic.org
COLOPHON
http://code.google.com/speed/page-speed/docs/rules_intro.html
http://ASIN.cc/~4bAFW
http://developer.yahoo.com/performance/rules.html
http://helveticons.ch/
Antoine BERNIER (abernier)2011
EXSTATIC[example.org’s statics]