当前位置: 动力学知识库 > 问答 > 编程问答 >

Rack::Deflater and gzip in rails app

问题描述:

I added use Rack::Deflater to config.ru in an attempt to serve gzipped css and js.

but when I load the page I still see that css and js are served and not the css.gz

should I see css.gz or js.gz? or did I miss something

网友答案:

This is the correct behavior. Check your HTTP headers to see if the gzip compression actually works:

curl -I -H "Accept-Encoding: gzip,deflate" <url>

This should return something like Content-Encoding: gzip if gzip compression is enabled.

You can also see the compressed output by using a lowercase -i. Alternatively to curl, you can also use the WebKit developer tools (or something similiar) to check this.

分享给朋友:
您可能感兴趣的文章:
随机阅读: