我运行了Google的pagespeed,它建议压缩我的.js和.css
在上面的内容中消除渲染阻止JavaScript和CSS显示如何修复
Enable compression
Compressing resources with gzip or deflate can reduce the number of bytes sent over the network.
Enable compression for the following resources to reduce their transfer size by 210.9KiB (68% reduction).
Compressing http://xx.com/content/bundles/js.min.js could save 157.3KiB (65% reduction).
Compressing http://xx.com/content/bundles/css.min.css could save 35.5KiB (79% reduction).
Compressing http://xx.com/ could save 18.1KiB (79% reduction).
Run Code Online (Sandbox Code Playgroud)
在我发布的过程中,我有一个步骤,使用Windows Powershell将.js和.css模拟的bundle移动到S3,然后转到cloudfront.
我可以在PowerShell脚本中添加一些可以压缩.js和.css文件的步骤吗?
此外,一旦文件被压缩,那么我是否必须做更多的事情而不是更改名称,以便告诉我的浏览器它需要尝试接受gzip文件?