Db caching just creating empty folders |
[eluser]tomasb[/eluser]
Hi folks, I'm trying to implement the db caching class. I have set the cache directory, and the permissions on it are correct. There is a simple db query in my Index function. This runs fine and creates the "default+index" folder as expected. However, no matter what variations I have tried, no cache files are actually getting written to the "default+index" folder. Permissions are also correct on this folder (777). Any ideas? Much appreciated T
[eluser]TheFuzzy0ne[/eluser]
Only read queries are cached, not update/insert/delete queries. Posting some code might help us ascertain the problem more effectively.
[eluser]tomasb[/eluser]
Yep, it's a simple read query: Code: $data['query'] = $this->db->get('data');
[eluser]tomasb[/eluser]
I set the boolean in database.php to true: $db['default']['cache_on'] = TRUE; This is just while I am testing. If I can get past this stage I will use the $this->db->cache_on(); method to cache individual queries. Cheers, T
[eluser]TheFuzzy0ne[/eluser]
As far as I am aware, that only enables caching. You still need to use $this->db->start_cache() and $this->db->stop_cache() accordingly.
[eluser]tomasb[/eluser]
Hey again, I tried adding the db->start_cache() and stop around the query.. still no joy. The cache folder I am trying to write to is outside the application folder. I doubt this has anything to do with it as it is creating the default+index folder correctly.. just not writing anything to it. Thanks for all your advice so far mate, T
[eluser]tomasb[/eluser]
So in my database.php I define: Code: $db['default']['cache_on'] = TRUE; and in my index function: Code: function index(){ This works fine on localhost, but not on my test server. Permissions on the created folder are fine and regular $this->output->cache method works fine. If I use the: Code: $this->db->start_cache(); I get the same results: folder is created but no cache entry inside. Cheers again, T
[eluser]Unknown[/eluser]
I am not so knowledgeable about this matter. So i have to learn it. Thanks for the post. taux pret auto - taux pret auto differe selon la rise en compte ... calculent automatiquement le taux pour un prĂȘt automobile donne. |
Welcome Guest, Not a member yet? Register Sign In |