General developer forum

Purging a specific cache

 
Picture of tim st.clair
Purging a specific cache
Group Plugin developers

Is there a programmatic way to purge a specific cache item. I have a no-so-frequent need to purge the caches for activity completion (for various reasons that would probably horrify the core team, but we won't speak of that) or can someone point me to the code where caching of this value occurs so I can figure out how to do it myself.

 
Average of ratings: Useful (1)
Picture of Michael Aherne
Re: Purging a specific cache
Group Core developersGroup Plugin developers
Sounds like you're looking for cache_helper::purge_by_definition($component, $area)
 
Average of ratings: Useful (1)
Tim at Lone Pine Koala Sanctuary
Re: Purging a specific cache
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers
You can do this under Admin -> Plugins -> Caching -> Cache configuration. There is a separate purge link for each bit of cache.
 
Average of ratings: Useful (1)