Ich habe versucht, die Hebel-Cache-Cache für eine ganze Weile zu bekommen, und ich habe keine Ahnung, was das Problem sein könnte. Ich habe verschiedene Methoden ausprobiert, um es zu aktivieren, aber nichts funktioniert ...Nutzen Browser-Caching funktioniert nicht - Htaccess & mod_expires Active
Die Seite läuft auf Namecheap Hosting. Ich kontaktierte bereits die Unterstützung und fragte, ob das mod_expires Modul aktiv ist und entsprechend der Kundenbetreuung ist es ...
Dies ist der Code, Ive wurde mit:
# START --- Browser Cache Control
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>
# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
# END --- Browser Cache Control
ich habe bereits versucht, einige andere Methoden wie:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
Es ist wirklich schön wäre, wenn jemand eine Idee hat, was mit meinem Code falsch sein könnte;)
Ich bin mit dem gleichen Problem konfrontiert. Egal, was ich in 'htaccess' geändert habe, es funktioniert nicht –