Home

Path Cache patch


Description:
This patch can greatly reduce the number of database queries on every page load caused by URL path aliases. Groups of paths are cached together for each page and language allowing optimal cache retrieval of cached paths. Furthermore, a whitelist is built for uncached paths to intelligently limit the necessary database queries.

This patch was backported from Drupal 7.

If using this patch with the database, you will need to define the 'cache_path' database table.

For MySQL:

    CREATE TABLE cache_path (
      cid varchar(255) NOT NULL default '',
      data longblob,
      expire int NOT NULL default '0',
      created int NOT NULL default '0',
      headers text,
      serialized int(1) NOT NULL default '0',
      PRIMARY KEY (cid),
      INDEX expire (expire)
    ) /*!40100 DEFAULT CHARACTER SET UTF8 */;

For PostgreSQL:

    CREATE TABLE cache_path (
      cid varchar(255) NOT NULL default '',
      data bytea,
      expire int NOT NULL default '0',
      created int NOT NULL default '0',
      headers text,
      serialized smallint NOT NULL default '0',
      PRIMARY KEY (cid)
    );

If using this patch with memcache (recommended) you will need to define the 'cache_path' bin. Paths are cached for 24 hours and otherwise are not flushed.

Status:
This patch is derived from what was merged into Drupal 7.

Patches:
http://tag1consulting.com/patches#path-cache

Original patch source:
http://drupal.org/node/456824#path_cache
(Along with several other optimizations backported from Drupal 7.)