aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-08-28 08:51:33 +0000
committerAlex <alex@adnab.me>2023-08-28 08:51:33 +0000
commitbd50333ade4085fe4ca1d5dafc5f7ca280882879 (patch)
treedbd014bae015753526830a3e69a50552a5290821 /doc
parent170c6a2eacb6823b0e6d78bdd645a24f81b496bd (diff)
parent245a0882e18bb4ed2cb45e60ee13447a123922d6 (diff)
downloadgarage-bd50333ade4085fe4ca1d5dafc5f7ca280882879.tar.gz
garage-bd50333ade4085fe4ca1d5dafc5f7ca280882879.zip
Merge pull request 'reverse-proxy.md: Added caching section for Caddy.' (#614) from jpds/garage:caddy-cache into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/614
Diffstat (limited to 'doc')
-rw-r--r--doc/book/cookbook/reverse-proxy.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/book/cookbook/reverse-proxy.md b/doc/book/cookbook/reverse-proxy.md
index 9c833ad0..bacac2ef 100644
--- a/doc/book/cookbook/reverse-proxy.md
+++ b/doc/book/cookbook/reverse-proxy.md
@@ -378,6 +378,47 @@ admin.garage.tld {
But at the same time, the `reverse_proxy` is very flexible.
For a production deployment, you should [read its documentation](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy) as it supports features like DNS discovery of upstreams, load balancing with checks, streaming parameters, etc.
+### Caching
+
+Caddy can compiled with a
+[cache plugin](https://github.com/caddyserver/cache-handler) which can be used
+to provide a hot-cache at the webserver-level for static websites hosted by
+Garage.
+
+This can be configured as follows:
+
+```caddy
+# Caddy global configuration section
+{
+ # Bare minimum configuration to enable cache.
+ order cache before rewrite
+
+ cache
+
+ #cache
+ # allowed_http_verbs GET
+ # default_cache_control public
+ # ttl 8h
+ #}
+}
+
+# Site specific section
+https:// {
+ cache
+
+ #cache {
+ # timeout {
+ # backend 30s
+ # }
+ #}
+
+ reverse_proxy ...
+}
+```
+
+Caching is a complicated subject, and the reader is encouraged to study the
+available options provided by the plugin.
+
### On-demand TLS
Caddy supports a technique called