JavaScript Caching Test

This tool helps you check all javascript resources on your website are cached or not. By caching the javascript resources, the page load time can be reduced. Page load time is one of the factors in a search engine rankings to the your website.



How do cache all your javascript resources?

You can set of the expires tag headers for your javascript resources. You can add the following lines into your .web.conf file:

location ~* \.(js)$ {
    add_header        Cache-Control public;
    add_header        Cache-Control must-revalidate;
    expires           7d;
}

If you using .htaccess file:


  ExpiresActive On
  ExpiresByType application/x-javascript "access plus 216000 seconds"
  ExpiresByType application/javascript "access plus 216000 seconds"

This script will only work if you have mod_expires and mod_headers enabled in Apache