Upload
thadafinser
View
488
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Vortrag beim LinuxDay 2012 in Dornbirn. Referent: Martin Keckeis Schnelle Ladezeiten von Webseiten/Applikationen werden immer wichtiger. Besonders mit dem Beginn der mobilen Endgeräte hat sich die Lage im Web verschärft, da die Bandbreiten um vielfaches kleiner sind als beim klassischen PC. Wenn Ihre Webseite langsam lädt, sind ihre Besucher nicht nur unzufrieden, sondern werden auch nicht mehr so schnell wieder kommen. Ich zeige Ihnen, wie man mit bereits einfachen Tricks sehr viel Geschwindigkeit aus einer Webseite rausholen kann. Dazu stelle ich diverse Tools vor, mit denen einfach Optimierungspotenzial aufgezeigt werden kann.
Citation preview
2. ber michName: Martin KeckeisMatura HTL Dornbirn (Betriebsinformatik)Seit 2009 Softwareentwickler Internet/Intranet WebapplikationSeit 2010 bei ThyssenKrupp Presta ttigSonstiges Musikverein Snowboarden und spiele seit neuestem Paintball Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering2 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 3. Warum ist Geschwindigkeit wichtig? Hohe Ladezeiten =Unzufriedene Besucher = Weniger wiederkehrende Besucher =Weniger Seitenaufrufe =Kein Erfolg!Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering3 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 4. Die negativen Folgen hoher Ladezeiten+ 100ms bei Amazon? - 1% Umsatz+ 400ms bei Google? - 0,59% Suchanfragen pro Benutzer+ 400ms bei Yahoo? - 5-10% Traffic+ 2s bei Bing? - 4,3% Umsatz pro Benutzer Quelle: Martin Kliehm, http://de.slideshare.net/kliehm/performancewmfraWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering4 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 5. Die positiven Folgen schneller Ladezeiten- 2,2s Ladezeit bei Mozilla (Webseite) + 15,4% Downloads-30% Dateivolumen bei Google Maps + 30% Aufrufe-5s Ladezeit bei shopzilla + 25% Seitenaufrufe - 50% bentigte Server Quelle: Martin Kliehm, http://de.slideshare.net/kliehm/performancewmfraWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering5 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 6. Wie wird eine Webseite berhaupt geladen?Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering6 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 7. Wie wird eine Webseite berhaupt geladen?Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering7 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 8. Wie wird eine Webseite berhaupt geladen?Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering8 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 9. Wie wird eine Webseite berhaupt geladen? Schritt 3Was passiert mit den Response Headern und dem Body (HTML)? Auflistung aller wichtigen Header: http://de.wikipedia.org/wiki/Liste_der_HTTP-HeaderfelderWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering9 ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 10. Wo geht die Zeit verloren?Client Seite Server Seite 80-90%10-20%Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering10ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 11. Was fr Faktoren beeinflussen die Geschwindigkeit?Client Seite (Beispiele) Hardware des Client HTTP Client (Browser) Netzwerkanbindung DNS Lookup Inhalt der WebseiteServer Seite (Beispiele) Hardware des Servers HTTP Server (Webserver) Generieren des HTML (PHP, asp.net, JAVA, Datenbanken, ) Ladezeit von statischen KomponentenWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering11ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 12. WebserverKonfigurationWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering12ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 13. Webserver - KonfigurationKeep-Alive aktivieren TCP/IP Verbindungsaufbau ist teuer Ohne Keep-Alive (bei jedem Request) Syn Syn + Ack Ack + Request Mit Keep-Alive Ack + RequestVorsicht: Verbindung auf dem Webserver wird fr diesen Zeitraum reserviertWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering13ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 14. Webserver - KonfigurationKomprimierung aktivierenbertragungsgre wird VIEL geringer ca. 60-90% sind mglichHTML, CSS, JS, XML, JSON, sind mglich Bilder machen keinen Sinn!Apache EinstellungenWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering14ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 15. Webserver - KonfigurationCache Header setzenVorsicht: Bringt beim ersten mal laden nichts! (Cache ist meistens leer) Weshalb Komprimierung so wichtig ist Bilder, CSS, JS, HTML Inhalt halb statisch Startseite, Impressum, Apache Einstellungen:Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering15ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 16. Inhalt der Webseite AllgemeinWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering16ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 17. Inhalt der Webseite - AllgemeinPre Komprimierung von JS/CSS Alles was nicht fr die Ausfhrung bentigt wird, wird entfernt! Kommentare, Leerzeichen, Tabs, Umbrche, Lange Variablen werde gekrzt ~ 50-80% Einsparung der DateigreWichtig bei Mobilen Gerten, da die Cache limitierung ohne GZIP gemossen wirdBeispiel: http://refresh-sf.com/yui/Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering17ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 18. Inhalt der Webseite - AllgemeinWeniger HTTP RequestsCSS/JS Dateien miteinander verbindenBilder in Sprites verbinden Besonders Icons und kleine Background images In CSS per background-position auswhlbarServerseitig lsbarWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering18ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 19. Inhalt der Webseite - AllgemeinCDN verwendenContent delivery network Server wird entlastet Mehr parallele Downloads mglich Bei Weltweiten Zugriffen sehr wichtig Beispiel: Google Javascript CDN mit FallbackWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering19ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 20. Inhalt der Webseite HTMLWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering20ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 21. Inhalt der Webseite - HTMLValides HTML ausliefernQuirks-Modus beim Browser verhindern Performance Darstellungs FolgefehlerCheck: http://validator.w3.org/Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering21ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 22. Inhalt der Webseite - HTMLFlush early, flush oftenBrowser kann Teile bereits darstellen sogenannte chunks ausliefernAndere Dateien knnen bereits geladen werdenVorsicht: Header knnen nachher nicht mehr gendert werden!Webseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering22ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 23. Inhalt der Webseite - HTMLHTML 5 verwendenWas ist besser? "http://www.w3.org/TR/html4/strict.dtd"> 90 Zeichen / 15 ZeichenStandardmodus sogar beim Internet Explorer 6Check: http://html5test.comWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering23ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 24. Inhalt der Webseite - HTMLNur bentigte Elemente ausliefernLeerzeichen, Tabs und Umbrche entfernenKommentare entfernenZ.B: HTMLTidyWebseiten Performance24.11.2012LinuxDay Dornbirn, Martin Keckeis Presta Steering24ThyssenKrupp Chassis 2012 All rights reserved. Copying and distribution without the prior written approval of ThyssenKrupp Presta AG is expressly prohibited. Inventions capable of being protected are property of ThyssenKrupp Presta AG and are to be held confidential 25. Inhalt der Webseite - HTMLWeniger Elemente, weniger VerschachtelungJe mehr Ebenen und Elemente desto Grer ist die Seite = mehr Ladezeit Lnger dauern Javascript DOM Zugriffe = schlechte Client PerformanceTabellen Designs durch