From 90de4ecc146a7ed1ae169699b4e845619ffdb36b Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Thu, 24 Jul 2014 16:32:08 -0700 Subject: Issue #1261846 by catch, dawehner, brianV, Berdir, sun, xjm, sandipmkhairnar, marvil07, chrisjlee, Cottser, amitgoyal, Elijah Lynn, er.pushpinderrana: Document 1 MB cache limit in cache functions --- includes/cache.inc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/cache.inc b/includes/cache.inc index 09f4d753f..207bf6615 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -98,9 +98,11 @@ function cache_get_multiple(array &$cids, $bin = 'cache') { * @param $data * The data to store in the cache. Complex data types will be automatically * serialized before insertion. Strings will be stored as plain text and are - * not serialized. + * not serialized. Some storage engines only allow objects up to a maximum of + * 1MB in size to be stored by default. When caching large arrays or similar, + * take care to ensure $data does not exceed this size. * @param $bin - * The cache bin to store the data in. Valid core values are: + * (optional) The cache bin to store the data in. Valid core values are: * - cache: (default) Generic cache storage bin (used for theme registry, * locale date, list of simpletest tests, etc.). * - cache_block: Stores the content of various blocks. @@ -119,7 +121,7 @@ function cache_get_multiple(array &$cids, $bin = 'cache') { * the administrator panel. * - cache_path: Stores the system paths that have an alias. * @param $expire - * One of the following values: + * (optional) One of the following values: * - CACHE_PERMANENT: Indicates that the item should never be removed unless * explicitly told to using cache_clear_all() with a cache ID. * - CACHE_TEMPORARY: Indicates that the item should be removed at the next @@ -254,10 +256,12 @@ interface DrupalCacheInterface { * The cache ID of the data to store. * @param $data * The data to store in the cache. Complex data types will be automatically - * serialized before insertion. - * Strings will be stored as plain text and not serialized. + * serialized before insertion. Strings will be stored as plain text and not + * serialized. Some storage engines only allow objects up to a maximum of + * 1MB in size to be stored by default. When caching large arrays or + * similar, take care to ensure $data does not exceed this size. * @param $expire - * One of the following values: + * (optional) One of the following values: * - CACHE_PERMANENT: Indicates that the item should never be removed unless * explicitly told to using cache_clear_all() with a cache ID. * - CACHE_TEMPORARY: Indicates that the item should be removed at the next -- cgit v1.2.3