Generated OG image cache grows unbounded — no cleanup mechanism #51

Closed
opened 2026-06-21 14:54:49 +00:00 by jmiller · 2 comments
Owner

Problem

Generated/resized OG images are stored in images/mokoog/generated/ with no eviction or cleanup mechanism. ImageHelper::cleanup() exists but is never called anywhere in the codebase.

On sites with many articles, this directory grows indefinitely.

Fix

Options (pick one or combine):

  • Wire up ImageHelper::cleanup() to a Joomla scheduled task (plg_task_*)
  • Add an admin "Purge Cache" button in the component toolbar
  • Add a CLI command (php cli/mokoog.php cleanup)
  • Implement TTL-based auto-eviction (delete images older than N days)

Files

  • source/packages/plg_system_mokoog/src/Helper/ImageHelper.php:154-165 (existing cleanup method)
  • source/packages/plg_system_mokoog/src/Helper/ImageGenerator.php (generates images)
## Problem Generated/resized OG images are stored in `images/mokoog/generated/` with no eviction or cleanup mechanism. `ImageHelper::cleanup()` exists but is never called anywhere in the codebase. On sites with many articles, this directory grows indefinitely. ## Fix Options (pick one or combine): - Wire up `ImageHelper::cleanup()` to a Joomla scheduled task (`plg_task_*`) - Add an admin "Purge Cache" button in the component toolbar - Add a CLI command (`php cli/mokoog.php cleanup`) - Implement TTL-based auto-eviction (delete images older than N days) ## Files - `source/packages/plg_system_mokoog/src/Helper/ImageHelper.php:154-165` (existing cleanup method) - `source/packages/plg_system_mokoog/src/Helper/ImageGenerator.php` (generates images)
jmiller added the enhancement label 2026-06-21 14:54:49 +00:00
Author
Owner

Branch created: feature/51-generated-og-image-cache-grows-unbounded

git fetch origin
git checkout feature/51-generated-og-image-cache-grows-unbounded
Branch created: [`feature/51-generated-og-image-cache-grows-unbounded`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteOpenGraph/src/branch/feature/51-generated-og-image-cache-grows-unbounded) ```bash git fetch origin git checkout feature/51-generated-og-image-cache-grows-unbounded ```
Author
Owner

Low priority — ImageHelper::cleanup() exists but has no callers. ImageGenerator::generate() also has no callers. Cache growth is theoretical until image generation is wired into a workflow. Can address when image generation is actually activated.

Low priority — `ImageHelper::cleanup()` exists but has no callers. `ImageGenerator::generate()` also has no callers. Cache growth is theoretical until image generation is wired into a workflow. Can address when image generation is actually activated.
Sign in to join this conversation.
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteOpenGraph#51