Hallo Leute,
Ich dachte wir können hier mal einen Diskussions-Thread starten über Performance. Das ganze ist natürlich Themenübergreifend über Server, PHP, Dateigröße, ...
Wir können uns unterhalten über die optimalen Browser-Caching-Verfahren (Expires/max-age)/(last-modified/etag), Dateigröße minimieren, komprimierte Übertragung, ...
Wichtige Ressourcen sind unter anderem:
Meine bisherigen wichtigsten Erfahrungen sind:
- Serverseitige Komprimierung --> Eintrag in .htaccess mit Ouput-Filter für DEFLATE oder GZIP
- statische Dateien komprimieren, also Kommentare entfernen, (doppelte)Leerzeichen, Zeilenumbrüche, ...
- Browser-Caching
Das "Problem" ist, dass man da so viele Konfigurationsmöglichkeiten hat, dass man kaum weiß, was denn nun optimal ist.
Meine derzeitige .htaccess auf dem Server; auf das wesentliche gekürzt:
- # Source: http://www.feedthebot.com/pagespeed/enable-compression.html
- # & http://www.initializr.com/builder?print&h5bp-htaccess (2014-02-05 18:00) ### gekürzt und angepasst für meinen Bedarf
- <IfModule mod_gzip.c>
- mod_gzip_on Yes
- mod_gzip_dechunk Yes
- mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
- mod_gzip_item_include handler ^cgi-script$
- mod_gzip_item_include mime ^text/.*
- mod_gzip_item_include mime ^application/x-javascript.*
- mod_gzip_item_exclude mime ^image/.*
- mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
- </IfModule>
- # ETag verhindern; Header-Größe verringern
- <IfModule mod_headers.c>
- Header unset ETag
- #Header set Connection Keep-Alive # kann deaktiviert werden: Standard seit Jahren von Servern und Browsern
- </IfModule>
- FileETag None
- <IfModule mod_expires.c>
- ExpiresActive on
- ExpiresDefault "access plus 1 month"
- ExpiresByType text/css "access plus 1 month"
- ExpiresByType application/json "access plus 0 seconds"
- ExpiresByType application/xml "access plus 0 seconds"
- ExpiresByType text/xml "access plus 0 seconds"
- ExpiresByType text/html "access plus 0 seconds"
- ExpiresByType image/x-icon "access plus 1 week"
- ExpiresByType application/javascript "access plus 1 month"
- ExpiresByType image/gif "access plus 1 month"
- ExpiresByType image/jpeg "access plus 1 month"
- ExpiresByType image/png "access plus 1 month"
- ExpiresByType image/webp "access plus 1 month"
- ExpiresByType video/webm "access plus 1 month"
- ExpiresByType application/atom+xml "access plus 1 hour"
- ExpiresByType application/rss+xml "access plus 1 hour"
- ExpiresByType application/x-font-ttf "access plus 1 month"
- ExpiresByType image/svg+xml "access plus 1 month"
- </IfModule>
Alles anzeigen
Kennt jemand von euch die .htaccess von initializr? Die Jungs und Mädels dort scheinen echt Ahnung zu haben, aber in ihrer htaccess (http://www.initializr.com/builder?print&h5bp-htaccess -08-06-2014 15:00 Uhr) verwenden sie "nur" DEFLATE anstatt GZIP. 
- <IfModule mod_deflate.c>
- # Force compression for mangled headers.
- # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
- <IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
- RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
- </IfModule>
- </IfModule>
- # Compress all output labeled with one of the following MIME-types
- # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
- # and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
- # as `AddOutputFilterByType` is still in the core directives).
- <IfModule mod_filter.c>
- AddOutputFilterByType DEFLATE application/atom+xml \
- application/javascript \
- application/json \
- application/ld+json \
- application/rss+xml \
- application/vnd.ms-fontobject \
- application/x-font-ttf \
- application/x-web-app-manifest+json \
- application/xhtml+xml \
- application/xml \
- font/opentype \
- image/svg+xml \
- image/x-icon \
- text/css \
- text/html \
- text/plain \
- text/x-component \
- text/xml
- </IfModule>
- </IfModule>
Alles anzeigen
Was hat ihr für Tipps, Meinungen, Erfahrungen, ... zu Komprimierung? (vor allem Serverseitig)
PS: wäre cool, wenn wir das Thema hier so aufbohren, wie damals PHP5-Hashing