Managing Static Files
bittnitt at gmail.com
bittnitt at gmail.com
Tue Jan 30 07:36:49 UTC 2024
Hi...I read a few articles about managing static files and I'm a bit confused!
I use Nginx as the main server to host my website
I enabled gzip and brotli
I have also enabled gzip_static and brotli_static
And I have pre-compressed all static files with gzip and brotli
I read in an article that after compressing all files, I should delete all uncompressed files to save memory and only gzip and Brotli files remain.
(Of course, I need to create an empty file called index.html for it to work properly)
Everything works fine now but my problem is when the browser doesn't support compression and requires uncompressed files.
In another article it was written that if gunzip is enabled for browsers that do not support the compressed format, it decompresses the gzip then sends it to the client.
But after doing some testing, I found (I think) that gnuzip only works if nginx is used as the proxy (between main server and client) (due to the content encoding header requirement).
Now, if I want to support gzip, brotli and non-compressed files, do I have to have all three types of files? Is this method correct? What method do you use? What method is suggested?Thanks
bitt-nitt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20240130/55b60d91/attachment.htm>
More information about the nginx
mailing list