From 89fe6e4978e47254ae0c349d02cab6b267e5076f Mon Sep 17 00:00:00 2001 From: unwox Date: Mon, 8 Sep 2025 13:36:42 +0600 Subject: allow specifying Cache-Control header for static files --- example/main.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/main.lua b/example/main.lua index 335eaad..8cca405 100644 --- a/example/main.lua +++ b/example/main.lua @@ -90,8 +90,9 @@ luna.router.route("GET /request", function () return 200, {}, "Your IP is: " .. response.body end) --- serve static files from static/ directory -luna.router.static("GET /static/", "static/") +-- serve static files from static/ directory. also cache them on the client +-- side for 1 hour. +luna.router.static("GET /static/", "static/", "public, immutable, max-age=3600") -- register a custom eval handler that will evaluate whatever is passed into -- luna stdio when it's run with -D flag. in this case we print the result of -- cgit v1.2.3