Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

codeigniter : what is the best practice for caching? [closed]

i'm working on a big project. i'm using codeigniter, but i'm facing a hard question, where should i using codeigniter caching. should i use it inside models? or in the controller? also as my project is big, i'm facing a hard time trying to guess what caches should i delete as the codeigniter caching is depending on the controller name, so when i update a table i have to check all controllers that are using that table and delete their cache. that kills me.

what is the best practice for this?

Thanks

like image 895
trrrrrrm Avatar asked Jan 17 '26 01:01

trrrrrrm


1 Answers

CodeIgniter have a good cache for small projects, but when you need to exclude things, it gets kind of messy. It's not decentralized.

A good solution for query cache is http://code.google.com/p/improved-query-caching/ and as Wesley told you, http://philsturgeon.co.uk/code/codeigniter-cache.

I also don't recommend using the query cache for ALL your queries, but instead using the ones that really needs it. It depends a LOT in the project and its size.

like image 83
juanrossi Avatar answered Jan 19 '26 15:01

juanrossi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!