summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2022-12-11 13:03:15 +0000
committerLibravatar GitHub <noreply@github.com>2022-12-11 13:03:15 +0000
commitcb2b2fd8058a71826f23f60036cb0232eee113c7 (patch)
tree761e6c0acc211c8ca9e8b957cd99d1e93668eebe /example
parent[docs] Caching webfinger with nginx (#1242) (diff)
downloadgotosocial-cb2b2fd8058a71826f23f60036cb0232eee113c7.tar.xz
[feature] support configuring database caches (#1246)
* update config generator to support nested structs, add cache configuration options * update envparsing test * add cache configuration to config parse tests * set cache configuration in testrig * move caches to sub-cache "gts" namespace, update envparsing, add cache config docs to example config Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'example')
-rw-r--r--example/config.yaml55
1 files changed, 55 insertions, 0 deletions
diff --git a/example/config.yaml b/example/config.yaml
index 7e02a702d..37ee84c09 100644
--- a/example/config.yaml
+++ b/example/config.yaml
@@ -164,6 +164,61 @@ db-tls-mode: "disable"
# Default: ""
db-tls-ca-cert: ""
+cache:
+ gts:
+ ###########################
+ #### DATABASE CACHES ######
+ ###########################
+ #
+ # Database cache configuration:
+ #
+ # Allows configuration of caches used
+ # when loading GTS models from the database.
+ #
+ # max-size = maximum cached objects count
+ # ttl = cached object lifetime
+ # sweep-freq = frequency to look for stale cache objects
+
+ account-max-size: 100
+ account-ttl: "5m"
+ account-sweep-freq: "10s"
+
+ block-max-size: 100
+ block-ttl: "5m"
+ block-sweep-freq: "10s"
+
+ domain-block-max-size: 1000
+ domain-block-ttl: "24h"
+ domain-block-sweep-freq: "1m"
+
+ emoji-max-size: 500
+ emoji-ttl: "5m"
+ emoji-sweep-freq: "10s"
+
+ emoji-category-max-size: 100
+ emoji-category-ttl: "5m"
+ emoji-category-sweep-freq: "10s"
+
+ mention-max-size: 500
+ mention-ttl: "5m"
+ mention-sweep-freq: "10s"
+
+ notification-max-size: 500
+ notification-ttl: "5m"
+ notification-sweep-freq: "10s"
+
+ status-max-size: 500
+ status-ttl: "5m"
+ status-sweep-freq: "10s"
+
+ tombstone-max-size: 100
+ tombstone-ttl: "5m"
+ tombstone-sweep-freq: "10s"
+
+ user-max-size: 100
+ user-ttl: "5m"
+ user-sweep-freq: "10s"
+
######################
##### WEB CONFIG #####
######################