Mal ein schönder Selbstversuch: Man nehme einen Blog unter WordPress und ein passendes Plugin wie W3 Total Cache und aktiviert sein CDN von einem eigenen, weiteren rootserver. Als Test dient nun mal ein Teil vom Layout, eine Titelgrafik als JPeg mit 51kB. Die Zeit für die erstmalige Übertragung der Datei sinkt nun von 99ms auf 19ms!
Variante 1
Alles von selben Apache/PHP/MySQL Server, also wie bisher:
Anfrage des Browsers
Host www.mampf-mit.de User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language de-de,de;q=0.8,en-gb;q=0.6,en-us;q=0.4,en;q=0.2 Accept-Encoding gzip, deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 DNT 1 Connection keep-alive Cookie ...
Antwort des Servers
Date Thu, 13 Oct 2011 12:30:19 GMT Server Apache/2.2.16 Vary Accept-Encoding,User-Agent Last-Modified Wed, 27 May 2009 05:33:37 GMT Etag "cbf6-46ade2f60ce40" Accept-Ranges bytes Content-Length 52214 Cache-Control public, must-revalidate, proxy-revalidate Expires Fri, 12 Oct 2012 12:30:19 GMT X-content-age 0 Pragma public X-Powered-By W3 Total Cache/0.9.2.4 Content-Type image/jpeg
Variante 2
Auslieferung statischer Inhalte über Lighttp.
Anfrage des Browsers
Host cdn.mampf-mit.de User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language de-de,de;q=0.8,en-gb;q=0.6,en-us;q=0.4,en;q=0.2 Accept-Encoding gzip, deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 DNT 1 Connection keep-alive
Antwort des Servers
Content-Type image/jpeg Accept-Ranges bytes Etag "969030608" Last-Modified Thu, 13 Oct 2011 12:27:28 GMT Content-Length 52214 Date Thu, 13 Oct 2011 12:30:24 GMT Server lighttpd/1.4.28
Fazit
Fünf mal so schnell, also lohnt sich!
Schön so.