caching JavaScript files

Which is the best method to make the browser use cached versions of js files (from the serverside)?


Have a look at Yahoo! tips: https://developer.yahoo.com/performance/rules.html#expires.

There are also tips by Google: https://developers.google.com/speed/docs/insights/LeverageBrowserCaching


or in the .htaccess file

AddOutputFilter DEFLATE css js
ExpiresActive On
ExpiresByType application/x-javascript A2592000