Codeigniter caching? Codeigniter caching? codeigniter codeigniter

Codeigniter caching?


The point of CI caching is to reduce the number of database queries, any time-consuming PHP calculations, etc... Basically, it will render a plain HTML page from your controller (and all the views it calls, of course). So, it won't really speed up your header and footer, unless you pull the data for them from the database or anythings that dynamic and heavy... but any modern browser will cache that for you unless you specifically disallow caching.

So, the bottom line, CI caching allows caching of the full pages only, no separate parts. Of course, there are alternative ways to achieve what you wanted, for example you can make the header and the footer separate controllers, put caching in them, and call them by AJAX... but I'm not sure it's worth it.


using extentions this is possible

https://github.com/philsturgeon/codeigniter-cache

usually the displaying isue too much of an issue, its the generation of the data which needs to be displayed which takes longer and benefits most from caching.


A little late to the conversation, but have you taken a look at database cache? A lot of the web page delay can come from heavy db queries. Caching the results opens up dynamic views.

This is helpful when you are managing sessions.

$this->db->cache_on();

Place this in your model instead of controller. Make sure you have a writable db-cache folder in your app directory as well.