htaccess и кэш, kohana

L
На сайте с 18.02.2012
Offline
83
803

Здравствуйте, как сделать кеширование ? что бы на сайте был какой то кэш.

Что бы каждый раз сайт с нуля не грузился.

У меня Фраемворк kohana

Я тут вычитал статью про это, код для файла htaccess, но статья для dle


<IfModule mod_expires.c>
ExpiresActive on

ExpiresDefault "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"

# html
ExpiresByType text/html "access plus 0 seconds"

# XML
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"

# RSS
ExpiresByType application/rss+xml "access plus 1 hour"

# Favicon
ExpiresByType image/x-icon "access plus 1 week"

# Картинки
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"

# HTC файлы (например css3pie)
ExpiresByType text/x-component "access plus 1 month"

# Нестандартные шрифты сайта
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS и javascript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"

</IfModule>

# Cache-Control браузера
<ifModule mod_headers.c>
# 30 дней
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
# 30 дней
<filesMatch "\.(css|js)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
# 2 дня
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</filesMatch>
# 1 день
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=172800, private, must-revalidate"
</filesMatch>
</ifModule>

<IfModule mod_setenvif.c>
#Эта конструкция для говнобраузера
#Запрет отдачи HTTP-заголовков Vary
BrowserMatch "MSIE" force-no-vary
BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary
</IfModule>

Может что то такое есть для коханы.

Reademonster
На сайте с 30.06.2014
Offline
17
#1

Вроде и для kohana подойдет

Где я монетезирую файловой трафик (http://installmonster.ru/ru/user/registration?ref=5117) (1к рублей с 1200-1300 посещений)

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий