[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/includes/ -> cache.inc (summary)

(no description)

File Size: 182 lines (7 kb)
Included or required: 1 time
Referenced: 3 times
Includes or requires: 0 files

Defines 3 functions

  cache_get()
  cache_set()
  cache_clear_all()

Functions
Functions that are not part of a class:

cache_get($cid, $table = 'cache')   X-Ref
Return data from the persistent cache. Data may be stored as either plain text or as serialized data.
cache_get will automatically return unserialized objects and arrays.

param: $cid
param: $table

cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL)   X-Ref
Store data in the persistent cache.

The persistent cache is split up into four database
tables. Contributed modules can add additional tables.

'cache_page': This table stores generated pages for anonymous
users. This is the only table affected by the page cache setting on
the administrator panel.

'cache_menu': Stores the cachable part of the users' menus.

'cache_filter': Stores filtered pieces of content. This table is
periodically cleared of stale entries by cron.

'cache': Generic cache storage table.

The reasons for having several tables are as follows:

- smaller tables allow for faster selects and inserts
- we try to put fast changing cache items and rather static
ones into different tables. The effect is that only the fast
changing tables will need a lot of writes to disk. The more
static tables will also be better cachable with MySQL's query cache

param: $cid
param: $data
param: $table
param: $expire
param: $headers

cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE)   X-Ref
Expire data from the cache. If called without arguments, expirable
entries will be cleared from the cache_page and cache_block tables.

param: $cid
param: $table
param: $wildcard



Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7