如果我用rake资源压缩了rails资产,我必须配置nginx来压缩资产(gzip设置为on):预编译?我的意思是没有意义吗?会表现好还是差?谢谢!
When files are precompiled,Sprockets also creates a gzipped (.gz)
version of your assets. Web servers are typically configured to use a
moderate compression ratio as a compromise,but since precompilation
happens once,Sprockets uses the maximum compression ratio,thus
reducing the size of the data transfer to the minimum. On the other
hand,web servers can be configured to serve compressed content
directly from disk,rather than deflating non-compressed files
themselves.
这对你很重要,因为它允许你使用gzip,如果你愿意,但它不强制你这样做. Gzip compression是真正的压缩(不仅仅是连接文件),可以减少传输数据量,而是牺牲处理器的功率(压缩和解压缩).根据页面大小和您的(和您的用户的)硬件,可能会显着提高您的网站.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。