The cache system is unique in the way it works. It is not based on time like other caches but rather it checks the contents of the sql_query function to see if it is updating or modifying a table in any way. If it finds a query like that then it will check to see if it is a table which has a cached query within a file called tables.txt stored in the cache/ folder. If it matches the tables then it will delete the previous cache and create a new one. Why not timed? Well why make a new cache file for something that hasnâ€™t changed.
Currently, only simple SELECT queries are supported. JOINS will not work and may cause errors. To cache a query, use the sql_query function as normal but add an extra argument to the call() function like so:
call('sql_query', "SELECT * FROM emoticons", 'cache');
The â€˜cacheâ€™ tells eoCMS to cache that query and use the data stored in the file from now on. The variable which you set this query to is now an array so please take note of this.
What to cache?
Only cache queries which will rarely be updated for example the emoticons. The way eoCMS stores the data is as follows:
serialized array here
Due to this, all of the data is safe, it cannot be accessed by the outside world. So sensitive data such as passwords are ok but not recommended.