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 --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5a16c26..58ed14c 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ as `luna.db["exec-tx"]`, `luna.http.encodeURL` as `luna.http["encode-url"]` and so on. Every argument in every API function is required: luna does not support optional -arguments yet. Pass an empty value for corresponding type instead if you do not +arguments yet. Pass an empty value of corresponding type instead if you do not want to specify an argument: {} for tables, "" for strings, 0 for numbers. @@ -84,11 +84,12 @@ end) ``` -__luna.router.static(pattern, directory)__: -registers a new route for Go to serve static files. +__luna.router.static(pattern, directory, cacheControl)__: +registers a new route for Go to serve static files. If `cacheControl` is +specified include Cache-Control header with specified value in a response. ```lua -luna.router.static("GET /static/", "./whatever/path/static") +luna.router.static("GET /static/", "./some/path/", "public, immutable, max-age=86400") ``` @@ -268,7 +269,7 @@ I will not accept patches that are * relying on too many Go (or external) dependencies. * adding too much complexity into the existing codebase. * adding a new major functionality that should be implemented outside - (for example service management, use systemd, shepherd or whatever). + (for example service management: use systemd, shepherd or whatever). ## Useful links -- cgit v1.2.3