Open Alex-ley opened 1 year ago
From what I understand this is not standard right? More of a workaround for more accurate progress bars when downloading compressed content?
@alexprengere yeah exactly. Sometimes the Brotli compression factor can be huge (which is great) but then any approximation of the compression factor is way off and the progress bar is almost useless. We’re using flask-compress at my start-up and we’re now adding this custom header to improve that. We’re sending huge files around so progress bars are really important.
I realize it’s non standard so that’s why I asked before doing a PR.
If you are open to it, I could put it behind a flag that is by default False/None and also potentially allow the user to chose the naming of this non standard header. So for most users they wouldn’t notice anything or be affected by it.
Of course, understand if you don’t want it in your library. Just thought I’d offer as we can’t be the only people who will face this challenge.
Feature request:
after_request
func (behind an optional flag in the init method if you don't want it to be a default behaviour), something like the below?If you would be open to it, I can also do a PR for it? But I didn't want to assume it would be accepted and do the PR without a discussion first.