{"id":197,"date":"2016-12-25T00:32:07","date_gmt":"2016-12-24T23:32:07","guid":{"rendered":"https:\/\/quantenfrosch.at\/blog\/?p=197"},"modified":"2018-08-24T00:32:23","modified_gmt":"2018-08-23T22:32:23","slug":"ladezeiten-reduzieren-mit-htaccess","status":"publish","type":"post","link":"https:\/\/quantenfrosch.at\/blog\/ladezeiten-reduzieren-mit-htaccess\/","title":{"rendered":"htaccess: Wordpress Ladezeiten verbessern"},"content":{"rendered":"<p>Die <strong>Performance <\/strong>von Webseiten geh\u00f6rt mit zu <strong>wichtisten Usability Faktoren<\/strong>. Denn langsame Webseiten stellen die Geduld der Besucher auf die Probe. Langsame Websites nerven.<br \/>\nUnd genervte Besucher kommen so schnell nicht wieder. Als Webseitenbetreiber sollte man daher der Optimierung der Ladegeschwindigkeit einen hohen Stellenwert einr\u00e4umen.<br \/>\nGl\u00fccklicherweise lassen sich auf Apache Webservern mit ein paar Handgriffen die Ladezeiten verbessern. Dies geschieht durch die <a href=\"https:\/\/wiki.selfhtml.org\/wiki\/Webserver\/htaccess\" target=\"_blank\" rel=\"noopener noreferrer\">htaccess<\/a>, einer Konfigurationsdatei f\u00fcr den Apache. Mit nur ein paar Eintr\u00e4gen in dieser Datei k\u00f6nnen teilweise erhebliche Verbesserungen bei der Ladegeschwindigkeit erzielt werden. Bauen Sie einfach nachfolgenden Code in die <strong>htaccess <\/strong>im Stammverzeichnis Ihrer Website ein.<!--more Weiterlesen--><\/p>\n<h3>Website-Performance verbessern mit htaccess<\/h3>\n<h5>Gzip Komprimierung aktivieren<\/h5>\n<p>Apache Webserver sind mit starken Komprimierungstools ausger\u00fcstet, die erheblich zur Verbesserung der Ladezeiten beitragen k\u00f6nnen, vor allem bei der <strong>Komprimierung<\/strong> von Textdateien. Eine Reduzierung der Dateigr\u00f6\u00dfen von 70% und mehr sind dabei keine Seltenheit. Versuchen Sie gzip mit folgendem Code in Ihrer htaccess zu aktivieren.<br \/>\n<code><br \/>\n# ----------------------------------------------------------------------<br \/>\n# | Komprimierung |<br \/>\n# ----------------------------------------------------------------------<br \/>\n&lt;IfModule mod_deflate.c&gt;<br \/>\nAddOutputFilterByType DEFLATE text\/plain<br \/>\nAddOutputFilterByType DEFLATE text\/html<br \/>\nAddOutputFilterByType DEFLATE text\/xml<br \/>\nAddOutputFilterByType DEFLATE text\/css<br \/>\nAddOutputFilterByType DEFLATE text\/javascript<br \/>\nAddOutputFilterByType DEFLATE application\/xml<br \/>\nAddOutputFilterByType DEFLATE application\/xhtml+xml<br \/>\nAddOutputFilterByType DEFLATE application\/rss+xml<br \/>\nAddOutputFilterByType DEFLATE application\/atom_xml<br \/>\nAddOutputFilterByType DEFLATE application\/javascript<br \/>\nAddOutputFilterByType DEFLATE application\/x-javascript<br \/>\nAddOutputFilterByType DEFLATE application\/x-shockwave-flash<br \/>\n&lt;\/IfModule&gt;<\/code><\/p>\n<h5>Caching steuern mit Expire Headers<\/h5>\n<p>Viele Dateien, die beim Aufruf einer Webseiten \u00fcbertragen werden, sind statische Ressourcen. Das bedeutet, sie bleiben bei jedem Seitenaufruf gleich und \u00e4ndern sich nicht. Dazu geh\u00f6ren u.a. Bilder, Grafiken, Javascript- und CSS-Datein. Es w\u00e4re ineffizient, wenn Nutzer bei jedem Besuch der Website s\u00e4mtliche Dateien erneut herunterladen m\u00fcssten. Stattdessen kann man einen Browser anweisen, die statischen Ressourcen einer Website im Cache abzulegen. Gesteuert wird dieses <strong>Caching<\/strong> mit Expire Headers in der htaccess.<br \/>\n<code><br \/>\n# ----------------------------------------------------------------------<br \/>\n# | Expire headers |<br \/>\n# ----------------------------------------------------------------------<br \/>\n&lt;IfModule mod_expires.c&gt;<br \/>\nExpiresActive on<br \/>\nExpiresDefault \"access plus 1 month\"<br \/>\nExpiresByType text\/css \"access plus 1 month\"<br \/>\nExpiresByType application\/atom+xml \"access plus 1 hour\"<br \/>\nExpiresByType application\/rdf+xml \"access plus 1 hour\"<br \/>\nExpiresByType application\/rss+xml \"access plus 1 hour\"<br \/>\nExpiresByType application\/json \"access plus 0 seconds\"<br \/>\nExpiresByType application\/ld+json \"access plus 0 seconds\"<br \/>\nExpiresByType application\/schema+json \"access plus 0 seconds\"<br \/>\nExpiresByType application\/vnd.geo+json \"access plus 0 seconds\"<br \/>\nExpiresByType application\/xml \"access plus 0 seconds\"<br \/>\nExpiresByType application\/pdf \"access 1 month\"<br \/>\nExpiresByType text\/xml \"access plus 0 seconds\"<br \/>\nExpiresByType image\/vnd.microsoft.icon \"access plus 1 week\"<br \/>\nExpiresByType image\/x-icon \"access plus 1 month\"<br \/>\nExpiresByType text\/html \"access plus 0 seconds\"<br \/>\nExpiresByType application\/javascript \"access plus 1 year\"<br \/>\nExpiresByType application\/x-javascript \"access plus 1 month\"<br \/>\nExpiresByType text\/javascript \"access plus 1 month\"<br \/>\nExpiresByType application\/manifest+json \"access plus 1 year\"<br \/>\nExpiresByType application\/x-web-app-manifest+json \"access plus 0 seconds\"<br \/>\nExpiresByType text\/cache-manifest \"access plus 0 seconds\"<br \/>\nExpiresByType audio\/ogg \"access plus 1 month\"<br \/>\nExpiresByType image\/bmp \"access plus 1 month\"<br \/>\nExpiresByType image\/gif \"access plus 1 year\"<br \/>\nExpiresByType image\/jpeg \"access plus 1 year\"<br \/>\nExpiresByType image\/jpg \"access 1 year\"<br \/>\nExpiresByType image\/png \"access plus 1 year\"<br \/>\nExpiresByType image\/svg+xml \"access plus 1 month\"<br \/>\nExpiresByType video\/mp4 \"access plus 1 month\"<br \/>\nExpiresByType video\/ogg \"access plus 1 month\"<br \/>\nExpiresByType video\/webm \"access plus 1 month\"<br \/>\nExpiresByType application\/vnd.ms-fontobject \"access plus 1 month\"<br \/>\nExpiresByType font\/eot \"access plus 1 month\"<br \/>\nExpiresByType font\/opentype \"access plus 1 month\"<br \/>\nExpiresByType application\/x-font-ttf \"access plus 1 month\"<br \/>\nExpiresByType application\/font-woff \"access plus 1 month\"<br \/>\nExpiresByType application\/x-font-woff \"access plus 1 month\"<br \/>\nExpiresByType font\/woff \"access plus 1 month\"<br \/>\nExpiresByType application\/font-woff2 \"access plus 1 month\"<br \/>\nExpiresByType text\/x-cross-domain-policy \"access plus 1 week\"<br \/>\n&lt;\/IfModule&gt;<br \/>\n<\/code><\/p>\n<h5>Etags entfernen<\/h5>\n<p>Etags (Entity Tags) wurden urspr\u00fcnglich mit HTTP 1.1 eingef\u00fchrt, um das Caching besser kontrollieren zu k\u00f6nnen. In der Praxis erwiesen sich <strong>ETags<\/strong> jedoch als problematisch. Daher ist die allgemein empfohlene Vorgehensweise, ETags komplett zu entfernen.<br \/>\n<code><br \/>\n# ----------------------------------------------------------------------<br \/>\n# | ETags |<br \/>\n# ----------------------------------------------------------------------<br \/>\n&lt;IfModule mod_headers.c&gt;<br \/>\nHeader unset ETag<br \/>\n&lt;\/IfModule&gt;<br \/>\nFileETag None<br \/>\n<\/code><\/p>\n<h5>Connection keep-alive aktivieren<\/h5>\n<p>Die Daten\u00fcbertragung auf <strong>keep-alive<\/strong> zu setzen erm\u00f6glicht es, mehrere Dateien \u00fcber eine Verbindung zu laden. Ohne \u201ekeep-alive\u201c m\u00fcsste der Browser f\u00fcr jede einzelne angeforderte Datei eine eigene Verbindung zum Webserver \u00f6ffnen, was den Datentransfer verlangsamt.<br \/>\n<code><br \/>\n# ----------------------------------------------------------------------<br \/>\n# | Keep alive |<br \/>\n# ----------------------------------------------------------------------<br \/>\n&lt;ifModule mod_headers.c&gt;<br \/>\nHeader set Connection keep-alive<br \/>\n&lt;\/ifModule&gt;<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Die Performance von Webseiten geh\u00f6rt mit zu wichtisten Usability Faktoren. Denn langsame Webseiten stellen die Geduld der Besucher auf die Probe. Langsame Websites nerven. Und genervte Besucher kommen so schnell<\/p>\n","protected":false},"author":6,"featured_media":196,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","rank_math_title":"htaccess: Ladezeiten reduzieren und Websites schneller machen\u00a0","rank_math_description":"Performance Optimierung - Erh\u00f6hen Sie die Ladegeschwindigkeit von Wordpress durch die Konfiguration des Webservers mittles htaccess.","rank_math_focus_keyword":"htaccess"},"categories":[12],"tags":[56],"class_list":["post-197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-performance"],"_links":{"self":[{"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":0,"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/media\/196"}],"wp:attachment":[{"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quantenfrosch.at\/blog\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}