相关疑难解决方法(0)

在发布到AWS S3之前,如何压缩/ gzip我的模拟.js和.css文件?

我运行了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文件?

css powershell gzip amazon-s3 amazon-web-services

9
推荐指数
2
解决办法
2950
查看次数

标签 统计

amazon-s3 ×1

amazon-web-services ×1

css ×1

gzip ×1

powershell ×1