Ablaufdatum für Dateien festlegen – FTP Server
Wenn man den Pagespeed Test von Google durchführt wird man unweigerlich mit der Tatsache konfrontiert, dass man kein Ablaufdatum für die Bilder und andere Dateien festgelegt hat. Nur was machen, wenn man keinen Server hat, sondern nur einen Webspace mit FTP Zugang?
Ablaufdatum auf FTP Server einstellen
Um auf einem FTP Server das Ablaufdatum festzulegen muss folgender Code an erster Stelle in die .htaccess
Datei, die im Root Ordner liegt, kopiert werden. Schon erkennt Google, dass Ablaufdatum für Bilder und anderen Dateien eingestellt wurden und der Pagespeed meckert nicht mehr.
Header set Connection Keep-Alive
AddOutputFilterByType DEFLATE text/html text/css text/javascript application/x-javascript application/x-httpd-php text/plain
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
AddType image/x-icon .ico
AddType image/png .png
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-opentype image/svg+xml
ExpiresActive On
ExpiresDefault "access plus 2 days"
ExpiresByType text/html "access plus 6 hours"
ExpiresByType image/gif "access plus 3 months"
ExpiresByType image/jpeg "access plus 3 months"
ExpiresByType image/jpg "access plus 3 months"
ExpiresByType image/png "access plus 3 months"
ExpiresByType image/x-png "access plus 3 months"
ExpiresByType text/css "access plus 8 days"
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType application/x-javascript "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType image/x-icon "access plus 3 months"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/x-font-opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
Ich habe versucht alle Dateiformate anzugeben und die Liste so umfangreich wie möglich zu gestalten. Sollten dennoch welche fehlen, so würde ich mich freuen, wenn Ihr mich in den Kommentaren darauf hinweist. Ich werde die Liste dann stetig erweitern.
Hinterlasse doch ein Kommentar
Schreibe ein Kommentar zu Ablaufdatum für Dateien festlegen – FTP Server
Wenn dir der Beitrag Ablaufdatum für Dateien festlegen – FTP Server gefallen hat oder du Kritik bzw. Verbesserungsvorschläge hast, dann würde ich mich freuen, wenn Du ein Kommentar hinterlassen würdest.