Files
growstuff/config/environments
Brenda WallaceandClaude Opus 5 888b0d1db9 Make memcached opt-in, default to a capped in-process cache
The free Memcachier dev plan is timing out on every call in production
(58 IO::TimeoutError in a 14 minute log window). Each request pays the
0.5s socket timeout and then renders uncached anyway, so the cache is
currently pure overhead on a dyno that is already being OOM-killed.

Memcached is now used only when USE_MEMCACHED=true and MEMCACHIER_SERVERS
is present. Otherwise production uses a memory store capped at 32MB via
RAILS_CACHE_SIZE_MB, so deploying restores real caching without the
timeouts and without an addon upgrade.

The memory store is per process, so homepage_stats gets an expires_in to
bound staleness. It is the only fragment that relies on expire_fragment
rather than a versioned cache key.

Sessions are cookie-based and every other cached value is either keyed by
cache_key_with_version or carries a TTL, so nothing depends on the cache
being shared between processes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 21:38:42 +12:00
..
2024-01-27 10:06:47 +10:30