tor, 17/05/2012 - 15:23
For at lade din besøg gemme statiske filer i deres browsere således de ikke skal hentes ved hver sidevisning, tilføjer du blot flg. til din .htaccess-fil:
# mod_expires <IfModule mod_expires.c> # Turn on Expires and set default to 0 ExpiresActive On ExpiresDefault A1209600 # 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 2 weeks <FilesMatch "\.(gif|jpg|jpeg|png|swf)$"> ExpiresDefault A1209600 Header append Cache-Control "public" </FilesMatch> # Set up 1 week caching on commonly updated files <FilesMatch "\.(xml|txt|html|js|css)$"> ExpiresDefault A604800 Header append Cache-Control "public" </FilesMatch> # Force no caching for dynamic files <FilesMatch "\.(php|cgi|pl|htm|html)$"> ExpiresActive Off Header append Cache-Control "private" </FilesMatch> </IfModule>
Gem filen og upload den til hotellet igen