this is my very first question and please excuse my poor English.
I was doing research about how can i improve my page speed and i found out about nginx gzip settings.
Below are my gzip settings from nginx.conf
I assume with these settings, nginx will serve .gz compressed file instead of original one if it exists. If not nginx will compress them when user requests them. Correct me if i'm wrong, am i on the right track?
My question is: Does Nginx compress original files every time new user requests it? Or does it serve cached/saved version of those compressed files?
Example: I have these files in my static folder.
/static/css/main.css /static/css/main.css.gz /static/js/main.js /static/js/main.js.gz /static/html/index.html
When userA requests index.html file Nginx will compress the file on the fly, But what if userB requests the same index.html file, does Nginx compress the file again or will it serve cached/saved version from somewhere?