Skip to content

Handle automatic cache purge (avoid capacity overflow) #6678

@chillu

Description

@chillu

Overview

Followup to #6252: We're using a new cache library, and still defaulting system caches to Filesystem (although we're choosing APC/opcache if available). As opposed to the old Zend_Cache solution, there's no way to limit the size of the cache. This leads to potential server capcity issues when old cache keys accumulate, particularly if they're based on timestamps as part of the cache key. The server might run out of disk space, or exhaust its filesystem nodes.

This issue should be solved in symfony/cache itself, so I've filed it there: symfony/symfony#21764 (comment)

Depending on the outcome, we might need to do more work in the framework to ensure a new purge() API is used automatically.

Acceptance Criteria

  • Expired cache entries get purged
  • This is enforced automatically (in-process cache purge for expired entries)
  • In-process cache purges don't exhaust server resources (PHP exec or mem)
  • Devs can opt in to background cache purging via a cron task
  • Continues to support non-expiring cache entries (acknowledging that they might get garbage collected when file size limit is reached)
  • Continues to support caches which aren't filesystem based (and do their own garbage collection)
  • Cache behaviour is well documented

Notes

  • Talk to platform operations about impact to their hosting context

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions