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
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_comp_level 5;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/vnd. ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon
gunzip on;
gzip_static on;
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?