How can I check that the nginx gzip_static module is working?

后端 未结 6 831
遇见更好的自我
遇见更好的自我 2021-01-30 00:58

How can I check that nginx is serving the .gz version of static files, if they exist?

I compiled nginx with the gzip static module, but I don\'t see any mention of the .

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 01:27

    Change the content of the non-gzipped file. And then touch both files (simultaneously—that is: in the same instantiation of touch). If when you load the file in an browser (cache-wiped) you get the non-changed file, then nginx served the static-cached-gzipped file.

    An easy way to avoid “did I just fetch the cache?” worries is to fetch from the command-line with curl since curl doesn’t cache.

提交回复
热议问题