开发者

chrome extensions: gzip css/js

开发者 https://www.devze.com 2023-03-26 17:11 出处:网络
i am making a chrome app. The js and css have now grown to be quiet large. i have no earlier experience with gzip. But i did some research and found that serving gzip files requires to make some chang

i am making a chrome app. The js and css have now grown to be quiet large. i have no earlier experience with gzip. But i did some research and found that serving gzip files requires to make some changes to .HTACCESS file. but it is not possible in my app. So can an开发者_高级运维yone give me a brief description of how to compress files and publish them successfully?


There is no point in compressing local files, it would just slow things down. All gzips, minifiers and such were made to battle network transfer speed at all costs as it is the bottleneck. For local files simple file read is much faster than read+decompress. For local files compression is used only to save disk space, not to speed things up.

The most you should do is minify your files (Google Closure Compiler, YUICompressor, packer, etc), as it makes files smaller and doesn't cost anything (just need to make sure that it doesn't over-minifying files at a cost of execution speed, I think packer has such option).

0

精彩评论

暂无评论...
验证码 换一张
取 消