RSS Feed/News Best practice for caching finder results (Entity Collections) in a controller?

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
31,110
Points
823

Reputation:

Hi everyone,

I'm building a custom addon for XenForo 2.3.x and I'm trying to implement caching in my controller to reduce database queries on my homepage. I'd appreciate some guidance on the correct approach.

What I'm trying to do:
Cache the result of multiple finder queries (threads, statistics) so they don't hit the database on every page load.

My current approach:

Fetching from cache:
PHP:

Code:
$cache = $this->app()->cache();
$key = 'index_data_v1';
$cachedData = $cache ...

Read more

Continue reading...
 
Status
Not open for further replies.
Top