CodeIgniter Forums

Full Version: cache_delete() not working?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Lovecannon[/eluser]
Well, whenever I update my database, I try to delete the influenced query cache files, like such:
Code:
$this->db->cache_delete('news', 'index');
                $this->db->cache_delete('news', 'article');
                $this->db->cache_delete('welcome', 'index');
but it does nothing..it does not delete, the only that will delete it is cache_delete_all(), but I will probably have to write my own method for removing the cache files >_>

El Forum

[eluser]Unknown[/eluser]
I just came across this myself, I did not have a trailing forward slash in my "system\application\config\database.php" file:

This did not work:

$db['default']['cachedir'] = "dbCache";

This did:

$db['default']['cachedir'] = "dbCache/";

Thought I'd post this incase it helps anyone else in the future.

C.

El Forum

[eluser]Unknown[/eluser]
This should really be emphasized in the documentation for the db caching. I was stuck until i found this.

Works really well after that, though.

El Forum

[eluser]iamjerson[/eluser]
Thanks a lot Chris i been it solves my problem too

El Forum

[eluser]Ehs4n[/eluser]
It solved my problem too. Thanks

El Forum

[eluser]pickupman[/eluser]
Count me in...just enabled DB caching and noticed cache files not being delete properly. Thanks.

El Forum

[eluser]er0k[/eluser]
[quote author="Chris Earl" date="1227514667"]I just came across this myself, I did not have a trailing forward slash in my "system\application\config\database.php" file:

This did not work:

$db['default']['cachedir'] = "dbCache";

This did:

$db['default']['cachedir'] = "dbCache/";

Thought I'd post this incase it helps anyone else in the future.

C.[/quote]

Whew thanks for this!

El Forum

[eluser]Fuad Hassa[/eluser]
Thanks a lot... It saved my day... yes that should have be written in the user guide.

El Forum

[eluser]CroNiX[/eluser]
[quote author="Fuad Hassa" date="1335328636"]Thanks a lot... It saved my day... yes that should have be written in the user guide.[/quote]
No, it would be much better to fix it so the trailing slash isn't necessary and make it like all of the other CI directory variables.

You are also welcome to contribute to the codebase on github. Most devs don't read these forums and are rarely here.

El Forum

[eluser]Fuad Hassa[/eluser]
[quote author="CroNiX" date="1335330932"][quote author="Fuad Hassa" date="1335328636"]Thanks a lot... It saved my day... yes that should have be written in the user guide.[/quote]
No, it would be much better to fix it so the trailing slash isn't necessary and make it like all of the other CI directory variables.

You are also welcome to contribute to the codebase on github. Most devs don't read these forums and are rarely here.[/quote]

I agree