-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gzip compressed files #1123
Comments
This seems like a bit of an edge case. I agree that the current behavior is not correct, but I'm not sure that I agree with you on what the correct behavior should be. If the contents of FWIW, Werkzeug's send_file (which is what is used by Flask to server files from the app's static dir) does appear to behave as you suggest. As to your use case, specifically: if one wants to know the compressed size of a file, that can, of course, be computed without actually storing the file in compressed form. E.g.
or similar. If, for optimization purposes, one wants to store pre-compressed data, I think that's more of a deployment issue. E.g. when using nginx's gzip_static module one would normally want both to deploy both a |
I tried using a
.svg.gz
file with Lektor, but it would not correctly serve this file.The file would be served with headers
but the file is still gzip compressed, i.e., without
This causes the browsers to attempt to parse the compressed data as XML, which obviously fails.
Of course I can just use .svg, and have my main web server do on the fly compression. The main reason I was looking into storing the images as .svg.gz was to be able compare transfer sizes for different formats and decide whether to store the images as .svg, .png or .webp. The .svg.gz size more accurately reflects when it is beneficial to switch to bitmap formats.
The text was updated successfully, but these errors were encountered: