XF 1.5 Use cache for the custom plugin

sajal

Active member
I'm bit of wondering about the cache usage in my custom Plug-in. I'm planning to use XenForo_Model_DataRegistry to store my cache data. Is that fine?

Does the cleanup of data_registry happen automatically Or do I need to take care of it manually for my plugin entries?

Also, do I able to set different cache time for my plugin, say I want to cache my custom plugin entries only for five minutes?

Any code snippets would help too.
 
Last edited:
The data registry is fine. Alternatively you can use the simple cache which writes to and from a special key within the data registry.

Regardless of which caching mechanism you use, you are responsible for cleaning it up, be that routinely when the data is not used or when you uninstall the add-on (in XF2, stuff saved in the simple cache is keyed by add-on and is removed automatically).

If you want to handle any sort of expiry then it would also be done manually (usually just a case of storing an array that contains your data plus an start/expiry date.
 
Top Bottom