File Caching does not work |
[eluser]Unknown[/eluser]
I load the driver in the constructor: Code: public function __construct() I call savetocache: Code: public function savetocache() Output (even if I refresh): Code: Saving to the cache! I call testcache: Code: public function testcache(){ Output: Code: bool(false) Code: a:3:{s:4:"time";i:1302827920;s:3:"ttl";i:300;s:4:"data";s:10:"foobarbaz!";} I'm running Code Igniter 2.0.2 with the following modification: Quote:Fixed Source: https://bitbucket.org/ellislab/codeignit...cache_file Please help
[eluser]bubbafoley[/eluser]
try this Code: public function __construct() This way you are telling the Cache driver library to use the file adapter by default. then your function looks like this Code: public function savetocache() The way you have it now you are using the file adapter to save the cache but not to retrieve it. If you don't pass a default adapter when loading the driver, you have to specify which adapter to use each time. Code: $this->load->driver('cache'); // using dummy cache by default |
Welcome Guest, Not a member yet? Register Sign In |