opensearch-project / documentation-website

The documentation for OpenSearch, OpenSearch Dashboards, and their associated plugins.
https://opensearch.org/docs
Apache License 2.0
70 stars 474 forks source link

[DOC] Document supported compression methods for OSD network requests #7111

Open joshuali925 opened 5 months ago

joshuali925 commented 5 months ago

What do you want to do?

Tell us about your request. Provide a summary of the request and all versions that are affected.

Dashboards sends minimized javascript for each plugin on page load. Some user choose to add a proxy in front of it for custom auth and security purposes. The largest javascript file is from observability plugin around 12MB, which exceeds some proxy or gateway maximum response size limit. Dashboards supports brotli and gzip (observability would be around 2.5MB) in addition to plaintext, but this is not documented and user might not know how to get dashboards to send compressed data instead of plaintext.

What other resources are available? Provide links to related issues, POCs, steps for testing, etc.

compression is added in webpack and available in OSD installation https://github.com/opensearch-project/OpenSearch-Dashboards/blob/7a8c281facb921d4af8aeeaa1ef80adb7d85b2ba/packages/osd-optimizer/src/worker/webpack.config.ts#L291-L302. might need OSD members to provide more technical details

joshuali925 commented 5 months ago

I think it's just as simple as

curl -XGET -I -sH 'Accept-encoding: br' -H 'Cookie: security_authentication=xxx' https://playground.opensearch.org/1/bundles/plugin/observabilityDashboards/observabilityDashboards.plugin.js

HTTP/1.1 200 OK
content-type: application/javascript; charset=utf-8
cache-control: max-age=31536000
content-encoding: br
osd-name: dashboards-opensearch-dashboards-55cf49965-9bcwz
vary: accept-encoding
Date: Wed, 08 May 2024 00:01:14 GMT
Connection: keep-alive
Keep-Alive: timeout=120
Transfer-Encoding: chunked

the difference is:

br: 1837493
gzip: 2541110
default: 12620796

But still good document the supported compression methods so people writing proxy can utilize compression

hdhalter commented 5 months ago

When was the feature implemented?

joshuali925 commented 5 months ago

since opensearch 1.0

hdhalter commented 5 months ago

Thanks, @joshuali925 , can you please start a PR for this?