From 0e3263b44d2762894588ff3e682579ec0cb77fa0 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 10 Mar 2011 16:37:35 +0000 Subject: Updated version number in User Guide html. --- user_guide/database/caching.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide/database/caching.html') diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index ec2e5c40b..4a18cbd64 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.0

CodeIgniter User Guide Version 2.0.1

-- cgit v1.2.3-24-g4f1b From 1f622294b92c095fd91e8ca44912d405c1605ded Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:06:51 -0400 Subject: Wow, I screwed that up, Reactor is going to 2.0.2 not 2.0.1 --- user_guide/database/caching.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide/database/caching.html') diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 4a18cbd64..3f4ef2bc3 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

-- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- user_guide/database/caching.html | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'user_guide/database/caching.html') diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 3f4ef2bc3..76a91216d 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -62,7 +62,7 @@ Database Caching Class

The Database Caching Class permits you to cache your queries as text files for reduced database load.

Important:  This class is initialized automatically by the database driver -when caching is enabled. Do NOT load this class manually.

+when caching is enabled. Do NOT load this class manually.

Also note:  Not all query result functions are available when you use caching. Please read this page carefully.

@@ -84,12 +84,12 @@ when caching is enabled. Do NOT load this class manually.

CodeIgniter's query caching system happens dynamically when your pages are viewed. When caching is enabled, the first time a web page is loaded, the query result object will be serialized and stored in a text file on your server. The next time the page is loaded the cache file will be used instead of -accessing your database. Your database usage can effectively be reduced to zero for any pages that have been cached.

+accessing your database. Your database usage can effectively be reduced to zero for any pages that have been cached.

Only read-type (SELECT) queries can be cached, since these are the only type of queries that produce a result. Write-type (INSERT, UPDATE, etc.) queries, since they don't generate a result, will not be cached by the system.

-

Cache files DO NOT expire. Any queries that have been cached will remain cached until you delete them. The caching system +

Cache files DO NOT expire. Any queries that have been cached will remain cached until you delete them. The caching system permits you clear caches associated with individual pages, or you can delete the entire collection of cache files. Typically you'll want to use the housekeeping functions described below to delete cache files after certain events take place, like when you've added new information to your database.

@@ -99,33 +99,33 @@ events take place, like when you've added new information to your database.

Getting a performance gain as a result of caching depends on many factors. 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 file-system is not -overly taxed. Remember that caching simply changes how your information is retrieved, shifting it from being a database +overly taxed. Remember that caching simply changes how your information is retrieved, shifting it from being a database operation to a file-system one.

In some clustered server environments, for example, caching may be detrimental since file-system operations are so intense. On single servers in shared environments, caching will probably be beneficial. Unfortunately there is no -single answer to the question of whether you should cache your database. It really depends on your situation.

+single answer to the question of whether you should cache your database. It really depends on your situation.

How are Cache Files Stored?

-

CodeIgniter places the result of EACH query into its own cache file. Sets of cache files are further organized into -sub-folders corresponding to your controller functions. To be precise, the sub-folders are named identically to the +

CodeIgniter places the result of EACH query into its own cache file. Sets of cache files are further organized into +sub-folders corresponding to your controller functions. To be precise, the sub-folders are named identically to the first two segments of your URI (the controller class name and function name).

For example, let's say you have a controller called blog with a function called comments that -contains three queries. The caching system will create a cache folder +contains three queries. The caching system will create a cache folder called blog+comments, into which it will write three cache files.

If you use dynamic queries that change based on information in your URI (when using pagination, for example), each instance of -the query will produce its own cache file. It's possible, therefore, to end up with many times more cache files than you have +the query will produce its own cache file. It's possible, therefore, to end up with many times more cache files than you have queries.

Managing your Cache Files

-

Since cache files do not expire, you'll need to build deletion routines into your application. For example, let's say you have a blog -that allows user commenting. Whenever a new comment is submitted you'll want to delete the cache files associated with the -controller function that serves up your comments. You'll find two delete functions described below that help you +

Since cache files do not expire, you'll need to build deletion routines into your application. For example, let's say you have a blog +that allows user commenting. Whenever a new comment is submitted you'll want to delete the cache files associated with the +controller function that serves up your comments. You'll find two delete functions described below that help you clear data.

@@ -155,8 +155,8 @@ pertain to run-time operations.

$this->db->cache_on()  /   $this->db->cache_off()

-

Manually enables/disables caching. This can be useful if you want to -keep certain queries from being cached. Example:

+

Manually enables/disables caching. This can be useful if you want to +keep certain queries from being cached. Example:

// Turn caching on
@@ -177,9 +177,9 @@ $query = $this->db->query("SELECT * FROM another_table");

Deletes the cache files associated with a particular page. This is useful if you need to clear caching after you update your database.

-

The caching system saves your cache files to folders that correspond to the URI of the page you are viewing. For example, if you are viewing +

The caching system saves your cache files to folders that correspond to the URI of the page you are viewing. For example, if you are viewing a page at example.com/index.php/blog/comments, the caching system will put all cache files associated with it in a folder -called blog+comments. To delete those particular cache files you will use:

+called blog+comments. To delete those particular cache files you will use:

$this->db->cache_delete('blog', 'comments'); @@ -188,7 +188,7 @@ called blog+comments. To delete those particular cache files you wil

$this->db->cache_delete_all()

-

Clears all existing cache files. Example:

+

Clears all existing cache files. Example:

$this->db->cache_delete_all(); -- cgit v1.2.3-24-g4f1b