XF 1.5 XenForo Core Cache Vs SimpleCache Vs DataRegistry Cache

sajal

Active member
I would appreciate if anyone could give insight into the different types of caches used by XF. Specifically, when to use which cache?

In my case, I've an API response that I'm supposed to cache for 15 minutes. Atm, I do store the data in Data-Registry using the XenForo_Model_DataRegistry class. On the other hand, I've prepared a cron script deletes cached cron entries from the xf_data_registry table. I'll run this cron script every 15 minutes.

Was wondering if there's a better approach to achieve this? I'm not sure if I could used SimpleCache for that as well?
 
Unless you need the data on most pages, don't use simple cache. That is loaded on every page view.

If you have to guarantee that it's cached, you probably do want to store it in the registry. The "normal" cache system is optional and thus probably not ideal for something like this.
 

Similar threads

Back
Top Bottom