1
In some of my modules, I'm using a modified version of Mithrandir's PersistableObjectHandler.
This version brings some news methods to the class but it is also capable to use cache (based on files)
With its cache, you can reduce your MySQL queries by 100% in your modules.
This cache script is coming from PEAR and the whole "system" (the PersistableObjectHandler class + the cache
system) in
only compatible with Php 5.
To store the cached files, the class uses a sub folder of the XOOPS upload folder (you have to create it, the
class does not do it for you)
I choose to use an unlimited cache life time.
The WHOLE cache is removed when the PersistableObjectHandler class is doing an
insert,
update or
delete.
Each sql query's result is stored in a unique file who's name is the md5 of the query (with the "start" and "limit")
You can change this name in the _getIdForCache method.
Data are automatically serialized by the Cache class and are also automatically unserialized by it.
The cache parameters are located and can be changed in the class constructor.
You can download this code hereand you can
read the cache manual here.
If someone, a developer, have some new ideas to bring on this subject, please share.