From 700f1d3de293d19d457992d70f3e2dd952b985e5 Mon Sep 17 00:00:00 2001 From: Florian Stecker Date: Wed, 22 May 2024 20:51:11 -0400 Subject: [PATCH] enable caching of css --- btrfs_explorer_bin/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/btrfs_explorer_bin/src/main.rs b/btrfs_explorer_bin/src/main.rs index f804a09..18ad70c 100644 --- a/btrfs_explorer_bin/src/main.rs +++ b/btrfs_explorer_bin/src/main.rs @@ -45,8 +45,8 @@ fn main() -> Result<(), MainError> { (GET) ["/tree/{tree}/{method}/{key}", tree: String, method: String, key: String] => btrfs_explorer::http_tree::http_tree(&image, &tree, Some(&method), Some(&key), request).unwrap(), (GET) ["/favicon.ico"] => Response::empty_404(), - (GET) ["/style.css"] => Response::from_data("text/css", CSS_FILE),// Response::from_file("text/css", File::open("style.css").unwrap()), -// (GET) ["/htmx.min.js"] => Response::from_file("text/css", File::open("htmx.min.js").unwrap()), + (GET) ["/style.css"] => Response::from_data("text/css", CSS_FILE) + .with_additional_header("Cache-Control", "max-age=3600"), _ => Response::empty_404(), ) });