?
avatar ptdev
ptdev
16 Dec 2015

When using APC caching on the global configuration, Joomla seems to cache on APC with the cache time in seconds.
The "cache time" field on the configuration states that: "The maximum length of time in minutes for a cache file to be stored before it is refreshed."
One would assume that setting the cache field to "10" would cache on APC for "600" seconds, but according to the APC status page, it saves it for 10 seconds, so it seems that Joomla isn't converting from the inputed field in minutes to seconds before storing it on APC.

avatar ptdev ptdev - open - 16 Dec 2015
avatar brianteeman brianteeman - change - 16 Dec 2015
Labels Added: ?
avatar ptdev
ptdev - comment - 17 Dec 2015

I've changed the JCacheStorageApc::store method to multiply the expiration value by 60 and it fixed my issue. While comparing the different cache engines I noticed that the redis engine also seems to be hardcoding the cache timeout to 3600s instead of using the _lifetime property.

avatar brianteeman
brianteeman - comment - 17 Dec 2015

Would you be able to submit a Pull Request to fix this?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8707.

avatar ptdev
ptdev - comment - 17 Dec 2015

Sorry, unfortunately not any time soon. Not only due to limited time but also because I'm not familiar with the Joomla core enough to confidently submit a pull request.
Also, my fix was actually just a quick fix since I'm just using apc so it was easy just going into the file and adding the correct lifetime.

Anyway, from my quick and dirty tests, the issue seems to exist on some other level and not just on JCacheStorageApc. Apparently the JCache class seems to be overriding the lifetime variable on the store method, rendering useless the lifetime property that get's set on JCacheStorage's constructor.

Imho, the cache system (at least jcache and jcachestorageX classes) would need to be reviewed and maybe get some more extensive tests.

avatar brianteeman brianteeman - change - 18 Dec 2015
Category Cache
avatar brianteeman brianteeman - change - 27 Mar 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-03-27 19:15:03
Closed_By brianteeman
avatar brianteeman brianteeman - close - 27 Mar 2016
avatar brianteeman
brianteeman - comment - 27 Mar 2016

Closing as this has been addressed in a larger rewrite of cache see #9622

Add a Comment

Login with GitHub to post a comment