From 5ffba1e7b3583ab5f3061fb77ae90fd1619af967 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 5 Oct 2006 04:23:18 +0000 Subject: --- user_guide/database/caching.html | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'user_guide/database/caching.html') diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 73f5d9c90..02003b540 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -66,21 +66,30 @@ Database Caching Class

The Database Caching Class contains functions that permit you to cache your queries.

-

Important:  This class must be initialized independently since it is a separate class from the main Database class. +

Important:  This class is initialized automatically by the database driver +when caching is enabled, so you do NOT need to load this class manually. More info below...

+

How Does Caching Work?

-

Initializing the Caching Class

+

When caching is enabled, anytime you run a "read" type query (SELECT) the result object will +be serialized and stored in a text file. Subsequent calls to that query will use the result from the cache file +rather then accessing your database.

-

To initialize this class please use the following code:

+

Code Igniter places your cached queries into sub-folders that are named based on the URI request. This allows +identical queries -$this->load->dbcache() -

You can also autoload this class from within your config/autoload.php file by specifying dbcache in the $autoload['libraries'] array.

+

If you run a "write" type query (INSERT, UPDATE, etc.) -

Once initialized you will access the functions using the $this->dbutil object:

+

Although caching queries reduces your database load, cached queries do require more +file-system operations, as cache files are created and read. Instead of accessing your database for information +text files are used. -$this->dbcache->some_function() +Whether you see a performance gain as a result of caching is dependant on many factors. +For example, if you have a highly optimized database under very little load, you probably won't see a performance boost. +If your database is under heavy use you probably will see an improved response, assuming your filesystem is not +overly taxed.

-- cgit v1.2.3-24-g4f1b