1

I am fiddling a bit with drupal 8 cache. Looking at cache_page table and there is clearly a value with CID i am trying to fetch. I try this.

if ($item = \Drupal::cache()->get($cid)) {
  dsm($item);
}

and keep getting nothing for that CID, when I try some CID from cache_default. I get it without problem. So I am wondering how to get values from other tables?

1 Answer 1

4

Provide the cache bin page, otherwise it defaults to default:

\Drupal::cache('page')->get($cid)
1
  • Of course. :) It was late in the evening and I knew there must be something like that, but didn't find any parameters in get function.
    – Blissful
    Nov 19, 2018 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.