A
A
Arthur2015-11-16 22:06:14
WordPress
Arthur, 2015-11-16 22:06:14

WordPress. How to remove "Use browser cache" from PageSpeed ​​Insights?

1. Installed HyperCash;
2. in htaccess:

<ifModule mod_headers.c>
    <FilesMatch "\.(html|htm)$">
        Header set Cache-Control "max-age=43200"
    </FilesMatch>
    <FilesMatch "\.(js|css|txt)$">
        Header set Cache-Control "max-age=604800"
    </FilesMatch>
    <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

# Cache Images
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"

# Cache other content types (Flash, CSS, JS, HTML, XML)
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType application/javascript "access plus 2592000 seconds"
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"

</ifModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

3. BWP Minify is installed (also with caching)
PageSpeed ​​swears at JS, png, jpg: "Use browser cache". How to cure such a problem?
In brackets next to each file: No expiration date specified

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Goncharov, 2015-11-27
@websanya

Maybe he swears at JS, png and jpg, which are not on your domain?
By the way, why are you using HyperCache and not W3 Total Cache? I wrote a great review on W3 Total Cache , I don't get these errors on my domain side with it.

R
Rinat Umyarov, 2019-01-18
@ren334

Regarding JS and pictures, the answers are here. It is written in detail about Wordpress optimization here: Optimizing a WordPress site . There is not enough information about the browser cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question