Skip to content

Commit

Permalink
Disabled compression middle to get download progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyang98 committed Aug 19, 2024
1 parent 44e7021 commit cd021a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.service(actix_files::Files::new("/data", "./data/").show_files_listing())
.service(actix_files::Files::new("/", "./static/").index_file("index.html"))
.wrap(middleware::Compress::default())
// NOTE: There is little benefit to using compress middleware when serving audio files
// since they are already extremely compressed. Additionally it also ends up removing
// the Content-Length header from the downloads since the file is being streamed.
// This has the effect of removing any progress bar on the download which is a bad experience.
// .wrap(middleware::Compress::default())
.wrap(middleware::Logger::default())
})
.bind((args.url, args.port))?
Expand Down

0 comments on commit cd021a1

Please sign in to comment.