Cache System

Dimofinf has a flexible professional system that caches the website pages. The following points are main ones for this system: 

- Cache files are saved in the path (contents/cache).

- Depending on the time range option in Dimofinf settings, the cache is saved for a certain period and new files are reset. 

- The process of cache is as following, the (startcache) function is called, and action is put in conditional IF function to assure the returned value from function. The function is searching if there is an existing cache of the page or not; if a cache is found, the file is fetched and displayed without going through the next steps. Otherwise, the action is executed and as a result the cache file is saved in its folder. 

Cache functions and constants: 

  define('CACHEGROUP', THIS_PRODUCT);

This constant is defining the main group in which cache files and variants are saved. Noting that this constant value is the module or page name.  

(startcache(CACHEGROUP

Is called at the start of the action as PHP code, this function is checking the cache files to assure if there is an existing one of the required page. In case a cache file is found, its value is returned again. 

(endcache(CACHEGROUP

Is called at the end of the action as PHP code, this function prints out the cache file content if it exists, or delete it if it exceeds the range time of saving. As well as, it creates new cache files. 

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)