Stale Page Cache After Chunk Edit in ModX 2.7
0 reputation · 26 Jan 2020, 14:19 UTC
The goal is to determine whether ModX 2.7’s automatic cache‑clearing logic correctly invalidates page cache entries when a chunk that is referenced by multiple resources is edited. The uncertainty lies in the fact that the built‑in “Cache Clearing on Resource Save” feature tracks direct dependencies, but indirect references (e.g., a snippet that pulls the chunk in several pages) may still leave stale files in the cache directory. Additionally, a race condition can occur when a resource is updated while its page cache is being written, potentially leaving the stale version served under high concurrency.
Because the cache engine (filesystem vs. database) and any third‑party plugins can alter when or if invalidation occurs, the behavior may differ between environments. The question is: Does ModX reliably purge page cache entries when a chunk referenced by multiple resources is updated, or is manual clearing required to avoid stale content? If not, what mechanisms can detect and resolve race conditions during concurrent resource edits that may leave stale cache on the filesystem?