From f662510f0ed64d1ad89e99d5f4626cd07751fd68 Mon Sep 17 00:00:00 2001 From: Claas Date: Sun, 29 Sep 2024 14:34:37 +0200 Subject: [PATCH] Configure server to serve compressed files for smaller downloads --- delivery-service/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/delivery-service/src/main.rs b/delivery-service/src/main.rs index 607c2cb..a6a7a9d 100644 --- a/delivery-service/src/main.rs +++ b/delivery-service/src/main.rs @@ -29,6 +29,10 @@ struct AppState { /// proxy delivery service requests for a better development experience. fn serve_client() -> ServeDir> { ServeDir::new("./app") + .precompressed_br() + .precompressed_deflate() + .precompressed_gzip() + .precompressed_zstd() // If the route is a client side navigation route, this will serve the app and let the app router take over the // path handling after the app is loaded .not_found_service(ServeFile::new("./app/index.html")) -- 2.51.2