Использование кэширования в браузере с помощью htaccess не работает - PullRequest
0 голосов
/ 04 сентября 2018

Мой сайт размещен на сервере ubuntu / apache2. Все мои оценки на GTMetrix зеленые, но использование кэширования в браузере всегда на F (0). Я должен был сделать все изменения на подаче, включить mod_expires, mod_deflate и т. Д., Но:

https://agenciahawks.com.br/wp-content/themes/hawks/css/bootstrap.min.css (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/css/owl.carousel.css (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/css/owl.theme.default.css (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/css/style.css (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/545454.png (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/Graphic-Designer.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/Inbound-Marketing-Strategy.png (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/SEO.png (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/about1.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/about2.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/background1.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/background2.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/background3.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/favicon.png (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/google_adwords.png (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/logo_hawks.png (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/logo_hawks_alt.png (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/luiz.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/meire.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/img/web-development.jpg (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/js/bootstrap.min.js (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/js/jquery.magnific-popup.js (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/js/jquery.min.js (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/js/main.js (expiration not specified)
https://agenciahawks.com.br/wp-content/themes/hawks/js/owl.carousel.min.js (expiration not specified)
https://in.hotjar.com/api/v1/sites/999532/pages/2291957264/content-id/18503726db48ec251bffa9e4d0db12e2 (expiration not specified)
https://in.hotjar.com/api/v1/sites/999532/url-hash/7fc9be33fdc2cc91dcbe3d0884d2e755/content (expiration not specified)
https://static.hotjar.com/c/hotjar-999532.js?sv=6 (1 minute)
https://www.googletagmanager.com/gtag/js?id=UA-125037225-1 (15 minutes)
https://www.google-analytics.com/analytics.js (2 hours)
https://mautic.agenciahawks.com.br/media/css/modal.min.css (4 hours)
https://mautic.agenciahawks.com.br/media/js/mautic-form.js (4 hours)

Теперь мой конфиг htacess:

 # Enable Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
</IfModule>
<IfModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
# Leverage Browser 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>

мой сайт https://agenciahawks.com.br. Все статистические данные отображаются на GTMetrix, Google Pagespeed, Sitechecker Pro, только кэширование с использованием браузера не работает. Извините, мой плохой английский, но мне нужна помощь.

...