0

Folks, a quick one - I'm caching fields e.g: $data from nodes using the following:

cache_set("nids:$nid", $data, 'my_custom_cache');

I have a cron set up to clear all cached data from this bin using the following:

cache_clear_all('nids', 'my_custom_cache', TRUE);

But, if I want to clear only one particular cached node, how would I achieve this? Currently tried:

cache_clear_all('nids:'.$nw->getIdentifier(), 'my_custom_cache', TRUE); 

But no luck, how do can I specify this?

  • 1
    That last line looks right, except you don't want a wildcard match if you're trying to match on the exact id – Clive Nov 5 '15 at 12:06
  • cache_clear_all('nids:'.$nw->getIdentifier(), 'cache_pwc_gant'); - this was it, cheers! – williamsowen Nov 5 '15 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.