When using cache, does the cache item need to be explicitly saved in the 'get' callback?

Status
This content is read-only, or is not open for further replies.

Kevin

Guest
offline
Using the example from @Jeremy P in this post about using the Symfony cache with XF 2.3, if we are using a callback to get the results if the cache key is not present or expired, do we need to explicitly save the item to cache in the callback function? Or do we need to do a 'getIem' & 'isHit' in combination with the callback? 🤔

In the quick test below, I'm always hitting the callback and am never hitting the cached copy.

Code:

Code:
$cacheKey = 'cinvin.testwidget';
$cache =...

Read more

Continue reading...
 
Liked by:
Status
This content is read-only, or is not open for further replies.
Top Bottom