| |
    今天发现一个问题,发现博客的js和css都没有gzip压缩,大号js动辄就20几k,很奇怪,以为是迁移导致的某个地方忘了开,查了下,发现之前的也没开,疑惑。

    我明明在ngix配置文件里加了gzip  on;了,但为啥js和css没有开呢,查了下nginx文档,原来默认只对text/html类型的压缩。

    加了一句:gzip_types application/x-javascript text/css
    ok,现在js和css都压缩了,加载速度又提高了不少。




Tags:
by snooda | 分类: nginx | 评论(0) | 引用(0) | 阅读(4736)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]