Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Frith620

1 Comments

Sorted by latest first Latest Oldest Best

 

@Bryan171

You can't manage the cache leverage for third-party JavaScript files.

However, you can do it for the JS files that you serve. For this, put these lines in your .htaccess file:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript "access plus 2592000 seconds"
</IfModule>

# Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch ".(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
</IfModule>


For my WordPress site, it worked to pass the cache leverage step in Google PageSpeed (for my internal scripts).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme