: How to manage the leverage browser caching for third party JS files? Is it possible to set and expiration date for the file http://assets.pinterest.com/js/pinit_main.js? And the other stuff down
Is it possible to set and expiration date for the file assets.pinterest.com/js/pinit_main.js? And the other stuff down the list?
I want to bring up my score as high as possible. I'm using WordPress by the way.
More posts by @Frith620
1 Comments
Sorted by latest first Latest Oldest Best
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).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.