use brotli compression #40, update and reduce dependencies
All checks were successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
Mylloon 2023-10-23 00:45:14 +02:00
parent c79041e7c8
commit 13e7c5197d
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 432 additions and 540 deletions

962
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -10,7 +10,7 @@ publish = false
license = "AGPL-3.0-or-later" license = "AGPL-3.0-or-later"
[dependencies] [dependencies]
actix-web = "4.4" actix-web = { version = "4.4", default-features = false, features = ["macros", "compress-brotli"] }
actix-files = "0.6" actix-files = "0.6"
cached = { version = "0.46", features = ["async"] } cached = { version = "0.46", features = ["async"] }
ramhorns = "0.14" ramhorns = "0.14"
@ -22,6 +22,6 @@ minify-js = "0.5"
glob = "0.3" glob = "0.3"
comrak = "0.19" comrak = "0.19"
reqwest = { version = "0.11", features = ["json"] } reqwest = { version = "0.11", features = ["json"] }
chrono = "0.4.30" chrono = { version = "0.4.30", default-features = false, features = ["clock"]}
chrono-tz = "0.8" chrono-tz = "0.8"
rss = { version = "2.0", features = ["atom"] } rss = { version = "2.0", features = ["atom"] }

View file

@ -1,5 +1,8 @@
use actix_files::Files; use actix_files::Files;
use actix_web::{middleware::DefaultHeaders, web, App, HttpServer}; use actix_web::{
middleware::{Compress, DefaultHeaders},
web, App, HttpServer,
};
use std::io::Result; use std::io::Result;
use crate::routes::{ use crate::routes::{
@ -29,6 +32,7 @@ async fn main() -> Result<()> {
HttpServer::new(move || { HttpServer::new(move || {
App::new() App::new()
.app_data(web::Data::new(config.to_owned())) .app_data(web::Data::new(config.to_owned()))
.wrap(Compress::default())
.wrap( .wrap(
DefaultHeaders::new() DefaultHeaders::new()
.add(( .add((