Also ich versteh das nicht.
Es gibt Anleitungen wie zB hier: http://blog.splash.de/2010/01/29/cac…e-via-htaccess/
wie man das Gnaze einrichtet.
Angefangen hab ich bei google: https://developers.google.com/speed/docs/best-practices/caching
Aber Es funktioniert nicht oo?
Was funktioniert ist:
PHP
// Cache-Lebensdauer (in Minuten)
$dauer = 15;
$exp_gmt = gmdate("D, d M Y H:i:s", time() + $dauer * 60) ." GMT";
$mod_gmt = gmdate("D, d M Y H:i:s", getlastmod()) ." GMT";
header("Expires: " . $exp_gmt);
header("Last-Modified: " . $mod_gmt);
header("Cache-Control: private, max-age=" . $dauer * 60);
// Speziell für MSIE 5
header("Cache-Control: pre-check=" . $dauer * 60, FALSE);
Alles anzeigen
Allerdings gilt das ja nicht für css,js, png ect ect -Dateien.
Daher wollte ich die htaccess Methde nutzen.
Das hier geht, ist ja aber ein festgelegtes Datum (also nicht sehr nützlich):
Code
<FilesMatch "\.(gif|flv|jpg|jpeg|png|gif|swf)$">
FileETag -INode MTime Size
# if you use ETags, you should unset Last-Modified
Header unset Last-Modified
Header set Cache-Control "max-age=86400, public, must-revalidate"
Header set Expires "Thu, 31 Dec 2010 20:00:00 GMT"
</FilesMatch>
<FilesMatch "\.(htm|html|php)$">
FileETag None
Header set Cache-Control "max-age=86400, public, must-revalidate"
</FilesMatch>
<FilesMatch "\.(js|css)$">
FileETag None
Header set Cache-Control "max-age=604800, public, must-revalidate"
Header set Expires "Thu, 31 Dec 2010 20:00:00 GMT"
</FilesMatch>
Alles anzeigen
Das hier suche ich glaube ich, aber funktioniert nicht:
Code
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 300 seconds"
ExpiresByType image/gif "access plus 1 month 1 hour"
ExpiresByType image/jpg "access plus 1 month 1 hour"
ExpiresByType image/jpeg "access plus 1 month 1 hour"
ExpiresByType image/png "access plus 1 month 1 hour"
ExpiresByType application/x-shockwave-flash "access plus 1 day 1 hour"
ExpiresByType text/css "access plus 1 day 1 hour"
ExpiresByType text/javascript "access plus 7 days 1 hour"
ExpiresByType application/x-javascript "access plus 7 days 1 hour"
</IfModule>
Alles anzeigen
Hat das schon mal jemand gemacht?