Skip to content
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

Brotli Compression #125

Open
coreybutler opened this issue Feb 10, 2021 · 1 comment
Open

Brotli Compression #125

coreybutler opened this issue Feb 10, 2021 · 1 comment
Assignees
Labels

Comments

@coreybutler
Copy link
Owner

Files which are pre-compressed with Brotli compression are not serving the appropriate compression headers. The file itself is served, but browsers do not decompress it when the HTTP header isn't present.

@coreybutler coreybutler self-assigned this Feb 10, 2021
@coreybutler coreybutler added Enhancement Request Investigating Looking into the issue. and removed Bug labels Feb 10, 2021
@coreybutler
Copy link
Owner Author

Brotli compression cannot be reliably detected on files at runtime. According to this study, there is a 95% false positive ratio, meaning practically nothing can be trusted. Brotli does not have identifying bytes, so attempting to automate this will be buggy at best. This differs from gzip compression, which does have identifying bytes (and could therefore be detected).

An alternative solution would be maintaining a list of files (or filename patterns, http route patterns, etc) which are pre-compressed. This list could be referenced at runtime, applying the appropriate HTTP response headers for brotli-compressed files. A lookup like this adds latency to response times, but it would be minimal and unperceivable. Most major object storage platforms (like S3) do something similar.

The alternative solution could be an option, similar to other runtime processing options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant