I’m just curious…
nginx will detect the gz files in the same dir,if it does not exists,it will use on-the-fly gzip and return a response(if gzip on)
so…when we turn gzip_static on,why nginx not to create a gz file with the output gzipped response?it’s about trunked encoding or something else?
So do I really need to write a bash script to create/update the gz files everytime I modify the static files,right?
Thanks ^_^
You’re right, as far as i can tell the two modules (gzip and gzip_static) don’t really interact. Anything compressed on the fly by gzip will possibly be cached for a short period of time, but will not be saved for gzip_static. A bash script to automatically update the .gz files is a good idea, and if you’re using source control, could be done as a post-command in Git or Hg.
It’s worth noting that for small files the overhead is arguably in the disk access rather than the compression.. but every little bit helps.