-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
server: compress large response payloads if client supports it #5310
Comments
https://pkg.go.dev/github.com/gorilla/handlers#CompressHandler we should perhaps just use something like that. 💭 |
Could you please assign this issue to me? I am looking for my first PR. |
Of course, @sanjeev98kumar 👍 I would not expect much time to be spent setting anything up — just clone the repo and get hacking :) |
+1 for supporting compression, we're also in need of this feature. |
@sanjeev98kumar any progress to report on this issue? 🙂 |
@anderseknert @srenatus can I pick this issue up if it's okay? |
@burnerlee since there's no response from @sanjeev98kumar for a while, I guess that's OK 👍 |
cool, I'll start working on the issue |
@srenatus can you help by giving me some insight into the issue? Like in which section of the project we're making this change and what do we exactly want to do? |
I've opened a draft PR from what I could understand from the issue description. Do we need to add this handler somewhere else too? |
Ideally, tests would tell us, I think. |
can I pick this issue or pair for this ? @anderseknert @srenatus |
Hey @irwanshofwan! Perhaps we could get an update from @burnerlee first? He has an open PR for this here, but as far as I can see, there's a few unaddressed comments there. An unforseen event here is how the gorilla library was archived just recently, so whoever works on this issue will likely want to await this PR to be merged. |
But either way, thanks for stepping up! 😃 |
hey @irwanshofwan please go ahead. I'm stuck in some other things rn and not able to contribute. Sorry for holding you guys back |
i would suggest continuing the same PR. we just need to handle the tests right now |
sure, will try continue from existing PR |
Whatever works best for you, but do see my note about gorilla above. |
sure, I believe we can do it parallel for this issue and rebase after the gorilla mux solved. |
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. |
@irwanshofwan any news on this ? Context: we use OPA heavily at Adobe and in some scenarios need |
@margelatu I believe this was put on hold while waiting for the router library situation to be resolved. But this is probably simple enough to pull off without having to use a helper from there, should anyone want to step up and do it :) |
Signed-off-by: Adrian Arnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
Signed-off-by: aarnautu <[email protected]>
…ed response and request body. It is available for the following REST API endpoints: - GET & POST HTTP methods on /v0/data & /v1/data endpoints - POST HTTP method on /v1/compile endpoint HTTP clients can optionally: - send 'Accept-Encoding: gzip' header and expect a gzip compressed body and a Content-Encoding: gzip response header. The server will send the content encoded as gzip only after a threshold defined by server.encoding.gzip.min_length (default value is 1024). If the size is below the threshold, the body is not compressed - send 'Content-Encoding: gzip' header and a gzip compressed body and expect the server to correctly interpret the request Fixes open-policy-agent#5310 Signed-off-by: aarnautu <[email protected]>
…ed response and request body. It is available for the following REST API endpoints: - GET & POST HTTP methods on /v0/data & /v1/data endpoints - POST HTTP method on /v1/compile endpoint HTTP clients can optionally: - send 'Accept-Encoding: gzip' header and expect a gzip compressed body and a Content-Encoding: gzip response header. The server will send the content encoded as gzip only after a threshold defined by server.encoding.gzip.min_length (default value is 1024). If the size is below the threshold, the body is not compressed - send 'Content-Encoding: gzip' header and a gzip compressed body and expect the server to correctly interpret the request Fixes open-policy-agent#5310 Signed-off-by: aarnautu <[email protected]>
…ed response and request body. (#5696) It is available for the following REST API endpoints: - GET & POST HTTP methods on /v0/data & /v1/data endpoints - POST HTTP method on /v1/compile endpoint HTTP clients can optionally: - send 'Accept-Encoding: gzip' header and expect a gzip compressed body and a Content-Encoding: gzip response header. The server will send the content encoded as gzip only after a threshold defined by server.encoding.gzip.min_length (default value is 1024). If the size is below the threshold, the body is not compressed - send 'Content-Encoding: gzip' header and a gzip compressed body and expect the server to correctly interpret the request Fixes #5310 Signed-off-by: aarnautu <[email protected]>
For certain types of payloads, or just exploratory browsing of
/data
, the main time spent for these queries is not inside of OPA, but waiting for data in transit. If the client supports content encoding like gzip, compressing the data may provide quite a dramatic reduction of payload size and hence total response time.Accept-Encoding
header includinggzip
...Content-Encoding: gzip
header and a gzip compressed payload.The text was updated successfully, but these errors were encountered: