3

My site is full of pre-compressed gzip files. In all cases, except for the index.html file, I don't need the non-gzip versions.

For example, if I have 1.html.gz, then I don't need to also have 1.html on my site.

And yet, if I have an index.html.gz file but I don't have an index.html, then my site completely fails to load. Is there a way to avoid this redundancy, or do I just need to cope with it?

NOTE: If it matters at all, my server's run by NGINX.

EDIT: even if I edit /etc/nginx/nginx.conf to have the line index index.html.gz, then it'll deliver the index page as a download-only file!

6
  • 1
    Why pre-compressed? I'm not sure all clients can handle gzip compression. Most web servers compress on the fly. Does nginx de-compress for clients that can't handle it? Commented Nov 3, 2018 at 21:41
  • How do you determine which file to serve?
    – MrWhite
    Commented Nov 3, 2018 at 21:54
  • Are you using Module ngx_http_gzip_static_module? Commented Nov 3, 2018 at 22:34
  • 1
    @Maximillian Laumeister Yes. All gzip files are correctly delivered.
    – abcjme
    Commented Nov 3, 2018 at 23:03
  • 1
    @MrWhite NGINX will deliver index.html by default. However, even if I edit /etc/nginx/nginx.conf to have the line index index.html.gz, then it'll deliver the index page as a download-only file!
    – abcjme
    Commented Nov 3, 2018 at 23:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.