M Cargo.toml => Cargo.toml +1 -0
@@ 18,6 18,7 @@ axum = { version = "0.7", features = ["tracing"] }
axum-extra = { version = "0.9", features = ["cookie"] }
axum-macros = "0.4"
tower = { version = "0.4", features = ["limit"] }
+tower-http = { version = "0.5", features = ["compression-full"] }
# HTTP client
reqwest = "0.11"
M src/http/mod.rs => src/http/mod.rs +2 -0
@@ 14,6 14,7 @@ use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::Semaphore;
use tower::limit::GlobalConcurrencyLimitLayer;
+use tower_http::compression::CompressionLayer;
mod entry;
mod feed;
@@ 40,6 41,7 @@ where Persistence: RussetPersistenceLayer {
.route("/subscribe", get(subscribe::subscribe_page).post(subscribe::subscribe))
.route("/*any", any(|| async { Redirect::to("/") }))
.layer(GlobalConcurrencyLimitLayer::with_semaphore(global_limit_semaphore))
+ .layer(CompressionLayer::new())
}
#[derive(Debug)]