Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Задайте правила эффективного использования кеша для ситических объектов


 Share

Recommended Posts

При проверке на скорость на сайте гугл 

 https://developers.google.com/speed/pagespeed/insights/

выдаёт: Задайте правила эффективного использования кеша для ситических объектов

Версия 1.5.4.1 

Можно ли добавить в .htaccess

ExpiresActive On 
ExpiresDefault "access plus 6 month"
ExpiresByType text/css "access plus 6 month" 
ExpiresByType text/plain "access plus 6 month"
ExpiresByType image/gif "access plus 6 month"
ExpiresByType image/png "access plus 6 month" 
ExpiresByType image/jpeg "access plus 6 month" 
ExpiresByType application/x-javascript "access plus 6 month"
ExpiresByType application/javascript "access plus 6 month"
ExpiresByType application/x-icon "access plus 6 month" 

и стоит ли?

Link to comment
Share on other sites


<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>

Нашел вот икой для оптимизации кэша от 2.0**

Link to comment
Share on other sites


Только что, Minelab сказал:

Нашел вот икой для оптимизации кэша от 2.0**

Ни в кем случае

ExpiresByType text/html "access 1 month"

Уберите

Link to comment
Share on other sites

17 minutes ago, markimax said:

Ни в кем случае

ExpiresByType text/html "access 1 month"

Уберите

<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 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>

Да можно?

Link to comment
Share on other sites


# кеширование в браузере на стороне пользователя
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 7 days"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/x-javascript "access 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/x-shockwave-flash "access 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>

Или вот ик, удалил строчку ExpiresByType text/html "access plus 7 day"

Link to comment
Share on other sites


  • 1 year later...

 

В 16.03.2020 в 11:11, markimax сказав:

Ни в кем случае

ExpiresByType text/html "access 1 month"

Уберите

 

ребятки подскажите а как для nginx икое же замутить? спасипотому что!

Link to comment
Share on other sites


  • 5 months later...
В 16.03.2020 в 11:11, markimax сказал:

Ни в кем случае

ExpiresByType text/html "access 1 month"

Уберите

а может чет не знаю, а зачем это убирать? если можно развернутый ответ) 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.