Cache RubyGems and NPM packages.