Created
January 19, 2015 09:36
-
-
Save zverush/a1d008aad62bbb5c4f46 to your computer and use it in GitHub Desktop.
Кеширование картинок
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ifModule mod_headers.c> | |
#кэшировать флэш и изображения на месяц | |
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$"> | |
Header set Cache-Control "max-age=2592000" | |
</FilesMatch> | |
#отключить кэширование | |
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"> | |
Header unset Cache-Control | |
</FilesMatch> | |
</IfModule> | |
<ifModule mod_expires.c> | |
ExpiresActive On | |
#по умолчанию кеш в 5 секунд | |
ExpiresDefault "access plus 5 seconds" | |
#кэшировать флэш и изображения на месяц | |
ExpiresByType image/x-icon "access plus 2592000 seconds" | |
ExpiresByType image/jpeg "access plus 2592000 seconds" | |
ExpiresByType image/png "access plus 2592000 seconds" | |
ExpiresByType image/gif "access plus 2592000 seconds" | |
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds" | |
</ifModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment