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

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
26,299
Points
823

Reputation:

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...
 
Status
Not open for further replies.
Top