ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:learn_caching:disk_caching

This is an old revision of the document!


Disk Based Caching

To maximize the performance of disk-based caching systems, the cached data should be placed on the fastest available file system, in order of preference:

  • A memory based file system (ramdisk), examples:
    • A windows product such as RamDisk
  • A linux tmpfs type file system
  • An SSD Disk based file system
  • A alternative disk to the one holding the database

Placing the cache files on a network drive is not recommended.

Configuration

The directory where the queries are saved is controlled by the variable $ADODB_CACHE_DIR

Default Cache Secs

The parameter $cacheSecs sets the default value of the time in seconds that cached queries are saved. If not set then the value is 3600. It can be set via either a normal connection object or a DSN type connection configuration.

This default value can be overridden on a query by query basis

/*
 * A connection object assumed
 */
$ADODB_CACHE_DIR = 'd:/queries';
$db->cacheSecs   = 6000;
v5/userguide/learn_caching/disk_caching.1459127470.txt.gz · Last modified: 2017/04/21 11:40 (external edit)