diff options
| author | unwox <me@unwox.com> | 2025-09-08 13:36:42 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2025-09-08 15:04:34 +0600 |
| commit | 89fe6e4978e47254ae0c349d02cab6b267e5076f (patch) | |
| tree | 21935d9d44aa39c9239c9027081e56146d3d0da6 /README.md | |
| parent | dbd1b030b0dc58df7cf86b6f14fa32a93c6f02b6 (diff) | |
allow specifying Cache-Control header for static files
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |
