rocket_async_compression 0.6.1

Response compression in both gzip and brotli formats for the Rocket webserver using the `async-compression` library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[macro_use]
extern crate rocket;

use rocket::fs::{relative, FileServer};
use rocket_async_compression::CachedCompression;

#[launch]
async fn rocket() -> _ {
    rocket::build()
        .mount(
            "/",
            FileServer::from(relative!("examples/cached-compression/static")),
        )
        .attach(CachedCompression::path_suffix_fairing(CachedCompression::static_paths(vec![".txt"])))
}