Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

7.x 2.x cache tagging

Andy Truong edited this page Jan 16, 2014 · 1 revision

Cache is easy, but invalidate cached data is hard. That's why we need cache tagging.

Tag cached item:

$callback = function() { return 'This is my complex logic!'; };
$options = array('id' => 'my_cache_id', 'tags' => array('tag 1', 'tag 2', 'tag 3'));
$output = at_cache($options, $callback);

Delete cached items by tag:

at_cache_flush_by_tags(array('tag 1'));

Clone this wiki locally