summaryrefslogtreecommitdiffstats
path: root/user_guide/database/caching.html
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-05 06:23:18 +0200
committeradmin <devnull@localhost>2006-10-05 06:23:18 +0200
commit5ffba1e7b3583ab5f3061fb77ae90fd1619af967 (patch)
tree89ccedf2b555db67f021f1c85bdaad5073d06fcd /user_guide/database/caching.html
parent44351bfc2a4dbd384bce7393cd76333885bf2c7f (diff)
Diffstat (limited to 'user_guide/database/caching.html')
-rw-r--r--user_guide/database/caching.html23
1 files changed, 16 insertions, 7 deletions
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
<p>The Database Caching Class contains functions that permit you to cache your queries.</p>
-<p class="important"><strong>Important:</strong>&nbsp; This class must be initialized independently since it is a separate class from the main Database class.
+<p class="important"><strong>Important:</strong>&nbsp; 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...</p>
+<h2>How Does Caching Work?</h2>
-<h2>Initializing the Caching Class</h2>
+<p>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.</p>
-<p>To initialize this class please use the following code:</p>
+<p>Code Igniter places your cached queries into sub-folders that are named based on the URI request. This allows
+identical queries
-<code>$this->load->dbcache()</code>
-<p>You can also autoload this class from within your <dfn>config/autoload.php</dfn> file by specifying <kbd>dbcache</kbd> in the <samp>$autoload['libraries']</samp> array.</p>
+<p>If you run a "write" type query (INSERT, UPDATE, etc.)
-<p>Once initialized you will access the functions using the <dfn>$this->dbutil</dfn> object:</p>
+<p>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.
-<code>$this->dbcache->some_function()</code>
+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.</p>