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

Introduce zstd & brotli compression + output buffering #2225

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

BelleNottelling
Copy link
Member

This PR will allow FOSSBilling to provide zstd, brotli, gzip, and deflate output compression on any webserver so long as the needed extensions are installed & opens up the ability for us to have programmatic control of it within the application.

The most interesting of these would be zstd which doesn't have official support by either NGINX or Apache. It's faster than any of the other options and overall matches brotli for compression, making it by far the superior choice for output compression.

This does have the chance to break stuff, however due to introducing output buffering. Essentially any instance where code uses exit will first need to use ob_end_flush to ensure the output is sent to the client.

Also output compression in FOSSBilling can be disabled so it can instead be handled by the webserver if desired, although I personally am in favor of being able to control as many aspects of FOSSBilling's behavior within the app itself as it helps minimize potential changes to config files once we have more webservers we provide support for (further down the line, I presume after most of the routing has been rewritten).

I plan on leaving this as a draft till others comment on what they think, as I am not entirely sure if there is perhaps a better way to make these changes.

For example: since this would already be messing with how the app outputs data, maybe we should go one step further and port a lot of the core functionality to a micro-framework such as Flight & eliminate most of the custom routing / response handling in FOSSBilling which would benefit the app in the long-run.

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

Successfully merging this pull request may close these issues.

None yet

1 participant