[UPDATE] New App\\Services\\FileCache — small filesystem-backed cache with a remember(key, ttl, producer) + forget(key) pattern. Atomic writes via tempnam+rename so concurrent readers never see a torn file. ttl=0 is a kill switch that short-circuits to the producer.
Applied to Forum::allGrouped for the guest role. The guest view has no per-user variation, so one snapshot (60s TTL) serves every unauthenticated request. Invalidation is wired into every Forum mutation (create, update, delete, softDelete, restore) so the next guest request rebuilds after any edit.
Logged-in users skip the cache — their view depends on membership/moderator state and fan-out of cache keys wouldn't pay off. The /stats cache from improvement item #1 stays as-is; its inline helper predates this service. Future extensions can use FileCache::remember() directly.
On this site specifically: guest browsing of forum content is restricted by category min_role_view, so the immediate user-facing win is small. The pattern + service are in place for when we extend caching elsewhere.
Refs: improvement list item #21.
Automated system post — 2026-04-18 11:11:31 CDT
. __ ____ ___ ____ _ _
/ /_| ___| / _ \___ \(_)___| |__
| '_ \___ \| | | |__) | / __| '_ \
| (_) |__) | |_| / __/| \__ \ | | |
\___/____/ \___/_____|_|___/_| |_|
D2sk - Sysop