Commit 40fb6f041d

40fb6f041df5470b7b175d8a1bbb2296d244c785

parent: 778622bce5

Verified · cmc ci/build: success ci/lint: success ci/test: success

cmc <hello@cleberg.net> · 2026-09-11 02:56 UTC

Turn the media cache on by default

A proxying instance with no cache re-fetches every image from wixmp on
every view. Defaults: enabled, lifetime 1w, max-size 200 MB, memcache
off. A config that sets enabled to false still turns it off.

Closes #12

Layout: unified · split

SETUP.md +1 −1
@@ -11,7 +11,7 @@ Time units:
1111# Config
1212* `listen` — IP and port to listen on in the following form: ip:port
1313* `uri` — Instance URI. Example: `"uri":"/art/"` -> https://skunky.ebloid.ru/art/
14* `cache` — Caching system for proxied media, avatars and emotes; default is off.
14* `cache` — Caching system for proxied media, avatars and emotes. On by default: `path` `cache`, `lifetime` `1w`, `max-size` `200`, `memcache` off. A proxying instance with no cache re-fetches every image from wixmp on every view, which is the pattern that gets an egress IP blocked.
1515 * `enabled` — Caching system state, requires boolean value
1616 * `path` — Path to cache directory. It must be writable by the user SkunkyArt
1717 runs as, and SkunkyArt refuses to start if it is not. The container image
app/config.go +3 −1
@@ -65,8 +65,10 @@ var CFG = config{
6565 Language: "auto",
6666 URI: "/",
6767 Cache: cacheConfig{
68 Enabled: false,
68 Enabled: true,
6969 Path: "cache",
70 Lifetime: "1w",
71 MaxSize: 200,
7072 UpdateInterval: 1,
7173 },
7274 APICache: apiCacheConfig{
app/config_test.go +7
@@ -36,3 +36,10 @@ func TestAPICacheDefaults(t *testing.T) {
3636 t.Errorf("defaults are %+v, want enabled, 64 MB, 5i", CFG.APICache)
3737 }
3838}
39
40func TestMediaCacheDefaults(t *testing.T) {
41 c := CFG.Cache
42 if !c.Enabled || c.Lifetime != "1w" || c.MaxSize != 200 || c.MemCache {
43 t.Errorf("defaults are %+v, want enabled, 1w, 200 MB, memcache off", c)
44 }
45}