开发者

chrome extensions: gzip css/js

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜