From f3428b56da5caed3d39438f31fe1b073c3c0e0c0 Mon Sep 17 00:00:00 2001
From: admin
When a "write" type query (INSERT, UPDATE, etc.) is run , any cache files associated with the particular page being viewed -will be deleted automatically. In some cases you may need to update some data with every page load (user stats, for example). -In these cases you'll proabably want to manually disable caching just before running your "write" query, then re-enable it just -after. Otherwise, your site will be caught ina cycle of writing/deleting caches, creating more load then if you were not using +will be deleted automatically. If you need to update some data with every page load (user stats, for example) you will +need to manually disable caching just before running your "write" query, then re-enable it just +after. Otherwise, your site will be caught in a cycle of writing/deleting caches with every page view, creating more load then if you were not using caching. More information on this will be found below.
@@ -106,6 +106,48 @@ single answer to the question of whether you should cache your database. It rea +Here is an example showing how you can selectively cache some queries and not others. Notice that the "write" type queries
+are not.
+
+ '>.$row->content.'
+$this->db->cache_on(); // Turns on caching. We assume that you've set up a valid cache foler...
+
+$query = $this->db->query("SELECT * FROM blog LIMIT 10);
+
+foreach ($query->result() as $row)
+{
+ echo '
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.2.3-24-g4f1b
'.$row->title.'
';
+ echo '