PHP Classes

Class Cache: Caching data in files of a given folder

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2004-02-19 (15 years ago) RSS 2.0 feedStarStarStar 49%Total: 1,518 All time: 2,546 This week: 339Up
Version License Categories
class_cache 1.0GNU General Publi...Files and Folders, Cache
Description Author

This class is capable of caching arbitrary data in files of a given folder.

This is meant to help reducing the time it takes to serve the same content of pages that would take a long time to generate and would slow down the access to such pages if they had to regenerated everytime when not using content caching.

The class works by checking if a cache file with a given key exists and it was not created since a longer time than the cache expiration period. If it does not exist or has expired, the data is stored in a cache file. Otherwise the data is retrieved from the cache file.

The class uses the MD5 algorithm to generate the names of the files on which the cached data is stored.

If the folder where the cache files are created does not exist, the class can create it and also store in them an empty index.html file and a .htaccess file with permissions set to deny access to the files via the Web in case you are using Apache as Web server.

The default cache expiry time is 86400 seconds. The default cache folder is the ./cache. You can change these values when the cache class object is created using the class constructor of ant time later the updateCache function.

Name: MARY Matthieu <contact>
Classes: 19 packages by
Country: France, Metropolitan France, Metropolitan
Age: 40
All time rank: 261 in France, Metropolitan France, Metropolitan
Week rank: 628 Down1 in France, Metropolitan France, Metropolitan Equal


  Files folder image Files  
File Role Description
Accessible without login Plain text file CHANGELOG Data changelog file
Plain text file class_cache.php Class This class_cache file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:2,546
This week:339Up
 User Ratings  
 All time