Kohana v3.3.5
This commit is contained in:
12
modules/cache/guide/cache/config.md
vendored
12
modules/cache/guide/cache/config.md
vendored
@@ -55,7 +55,7 @@ failure_callback | __NO__ | (_[callback](http://www.php.net/manual/en/language
|
||||
'driver' => 'memcache',
|
||||
'default_expire' => 3600,
|
||||
'compression' => FALSE, // Use Zlib compression
|
||||
(can cause issues with integers)
|
||||
// (can cause issues with integers)
|
||||
'servers' => array
|
||||
(
|
||||
'local' => array
|
||||
@@ -71,7 +71,7 @@ failure_callback | __NO__ | (_[callback](http://www.php.net/manual/en/language
|
||||
'driver' => 'memcachetag',
|
||||
'default_expire' => 3600,
|
||||
'compression' => FALSE, // Use Zlib compression
|
||||
(can cause issues with integers)
|
||||
// (can cause issues with integers)
|
||||
'servers' => array
|
||||
(
|
||||
'local' => array
|
||||
@@ -90,7 +90,15 @@ failure_callback | __NO__ | (_[callback](http://www.php.net/manual/en/language
|
||||
'driver' => 'apc',
|
||||
'default_expire' => 3600,
|
||||
),
|
||||
|
||||
## APCu settings
|
||||
|
||||
'apcu' => array
|
||||
(
|
||||
'driver' => 'apcu',
|
||||
'default_expire' => 3600,
|
||||
),
|
||||
|
||||
## SQLite settings
|
||||
|
||||
'sqlite' => array
|
||||
|
10
modules/cache/guide/cache/index.md
vendored
10
modules/cache/guide/cache/index.md
vendored
@@ -6,7 +6,7 @@ instances of cache engines through a grouped singleton pattern.
|
||||
|
||||
## Supported cache engines
|
||||
|
||||
* APC ([Cache_Apc])
|
||||
* APC/APCu ([Cache_Apc])
|
||||
* File ([Cache_File])
|
||||
* Memcached ([Cache_Memcache])
|
||||
* Memcached-tags ([Cache_Memcachetag])
|
||||
@@ -16,13 +16,13 @@ instances of cache engines through a grouped singleton pattern.
|
||||
## Introduction to caching
|
||||
|
||||
Caching should be implemented with consideration. Generally, caching the result of resources
|
||||
is faster than reprocessing them. Choosing what, how and when to cache is vital. [PHP APC](http://php.net/manual/en/book.apc.php) is one of the fastest caching systems available, closely followed by [Memcached](http://memcached.org/). [SQLite](http://www.sqlite.org/) and File caching are two of the slowest cache methods, however usually faster than reprocessing
|
||||
is faster than reprocessing them. Choosing what, how and when to cache is vital. [PHP APCu](http://php.net/manual/en/book.apcu.php) is one of the fastest caching systems available, closely followed by [Memcached](http://memcached.org/). [SQLite](http://www.sqlite.org/) and File caching are two of the slowest cache methods, however usually faster than reprocessing
|
||||
a complex set of instructions.
|
||||
|
||||
Caching engines that use memory are considerably faster than file based alternatives. But
|
||||
memory is limited whereas disk space is plentiful. If caching large datasets, such as large database result sets, it is best to use file caching.
|
||||
|
||||
[!!] Cache drivers require the relevant PHP extensions to be installed. APC, eAccelerator, Memecached and Xcache all require non-standard PHP extensions.
|
||||
[!!] Cache drivers require the relevant PHP extensions to be installed. APC, eAccelerator, Memecached and Xcache all require non-standard PHP extensions.
|
||||
|
||||
## What the Kohana Cache module does (and does not do)
|
||||
|
||||
@@ -43,7 +43,7 @@ Getting and setting values to cache is very simple when using the _Kohana Cache_
|
||||
|
||||
Driver | Storage | Speed | Tags | Distributed | Automatic Garbage Collection | Notes
|
||||
---------------- | ------------ | --------- | -------- | ----------- | ---------------------------- | -----------------------
|
||||
APC | __Memory__ | Excellent | No | No | Yes | Widely available PHP opcode caching solution, improves php execution performance
|
||||
APC/APCu | __Memory__ | Excellent | No | No | Yes | Widely available PHP opcode caching solution, improves php execution performance
|
||||
Wincache | __Memory__ | Excellent | No | No | Yes | Windows variant of APC
|
||||
File | __Disk__ | Poor | No | No | No | Marginally faster than execution
|
||||
Memcache (tag) | __Memory__ | Good | No (yes) | Yes | Yes | Generally fast distributed solution, but has a speed hit due to variable network latency and serialization
|
||||
@@ -54,4 +54,4 @@ It is possible to have hybrid cache solutions that use a combination of the engi
|
||||
## Minimum requirements
|
||||
|
||||
* Kohana 3.0.4
|
||||
* PHP 5.2.4 or greater
|
||||
* PHP 5.2.4 or greater
|
||||
|
10
modules/cache/guide/cache/usage.md
vendored
10
modules/cache/guide/cache/usage.md
vendored
@@ -9,7 +9,7 @@ Creating a new _Kohana Cache_ instance is simple, however it must be done using
|
||||
// Create a new instance of cache using the default group
|
||||
$cache = Cache::instance();
|
||||
|
||||
The default group will use whatever is set to [Cache::$default] and must have a corresponding [configuration](cache.config) definition for that group.
|
||||
The default group will use whatever is set to [Cache::$default] and must have a corresponding [configuration](config) definition for that group.
|
||||
|
||||
To create a cache instance using a group other than the _default_, simply provide the group name as an argument.
|
||||
|
||||
@@ -18,7 +18,7 @@ To create a cache instance using a group other than the _default_, simply provid
|
||||
|
||||
If there is a cache instance already instantiated then you can get it directly from the class member.
|
||||
|
||||
[!!] Beware that this can cause issues if you do not test for the instance before trying to access it.
|
||||
[!!] Beware that this can cause issues if you do not test for the instance before trying to access it.
|
||||
|
||||
// Check for the existance of the cache driver
|
||||
if (isset(Cache::$instances['memcache']))
|
||||
@@ -36,11 +36,11 @@ If there is a cache instance already instantiated then you can get it directly f
|
||||
|
||||
The cache library supports scalar and object values, utilising object serialization where required (or not supported by the caching engine). This means that the majority or objects can be cached without any modification.
|
||||
|
||||
[!!] Serialisation does not work with resource handles, such as filesystem, curl or socket resources.
|
||||
[!!] Serialisation does not work with resource handles, such as filesystem, curl or socket resources.
|
||||
|
||||
### Setting a value to cache
|
||||
|
||||
Setting a value to cache using the [Cache::set] method can be done in one of two ways; either using the Cache instance interface, which is good for atomic operations; or getting an instance and using that for multiple operations.
|
||||
Setting a value to cache using the [Cache::set] method can be done in one of two ways: either using the Cache instance interface, which is good for atomic operations, or getting an instance and using that for multiple operations.
|
||||
|
||||
The first example demonstrates how to quickly load and set a value to the default cache instance.
|
||||
|
||||
@@ -104,7 +104,7 @@ In cases where the requested key is not available or the entry has expired, a de
|
||||
|
||||
It is possible to retrieve values from cache grouped by tag, using the [Cache::find] method with drivers that support tagging.
|
||||
|
||||
[!!] The __Memcachetag__ driver does not support the `Cache::find($tag)` interface and will throw an exception.
|
||||
[!!] The __Memcachetag__ driver does not support the `Cache::find($tag)` interface and will throw an exception.
|
||||
|
||||
// Get an instance of cache
|
||||
$cache = Cache::instance('memcachetag');
|
||||
|
Reference in New Issue
Block a user