diff --git a/Cargo.lock b/Cargo.lock index 065078e7f7768..5de2372ae0faf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12482,6 +12482,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ + "async-compression", "bitflags 2.4.0", "bytes", "futures-core", diff --git a/src/meta/Cargo.toml b/src/meta/Cargo.toml index 20a82883e81ce..af47427398d56 100644 --- a/src/meta/Cargo.toml +++ b/src/meta/Cargo.toml @@ -92,7 +92,12 @@ uuid = { version = "1", features = ["v4"] } [target.'cfg(not(madsim))'.dependencies] axum = "0.6" -tower-http = { version = "0.4", features = ["add-extension", "cors", "fs"] } +tower-http = { version = "0.4", features = [ + "add-extension", + "cors", + "fs", + "compression-gzip", +] } workspace-hack = { path = "../workspace-hack" } [dev-dependencies] diff --git a/src/meta/src/dashboard/mod.rs b/src/meta/src/dashboard/mod.rs index f531991336db3..5e5a7476fa10c 100644 --- a/src/meta/src/dashboard/mod.rs +++ b/src/meta/src/dashboard/mod.rs @@ -33,6 +33,7 @@ use risingwave_rpc_client::ComputeClientPool; use thiserror_ext::AsReport; use tower::{ServiceBuilder, ServiceExt}; use tower_http::add_extension::AddExtensionLayer; +use tower_http::compression::CompressionLayer; use tower_http::cors::{self, CorsLayer}; use tower_http::services::ServeDir; @@ -63,7 +64,7 @@ pub(super) mod handlers { use risingwave_pb::catalog::table::TableType; use risingwave_pb::catalog::{Sink, Source, Table, View}; use risingwave_pb::common::{WorkerNode, WorkerType}; - use risingwave_pb::meta::{ActorLocation, PbTableFragments}; + use risingwave_pb::meta::PbTableFragments; use risingwave_pb::monitor_service::{ GetBackPressureResponse, HeapProfilingResponse, ListHeapProfilingResponse, StackTraceResponse, @@ -440,7 +441,8 @@ impl DashboardService { let app = Router::new() .fallback_service(dashboard_router) .nest("/api", api_router) - .nest("/trace", trace_ui_router); + .nest("/trace", trace_ui_router) + .layer(CompressionLayer::new()); axum::Server::bind(&srv.dashboard_addr) .serve(app.into_make_service())