views:

37

answers:

1

Hello,

I am using codeigniter db query caching and i would like to cache my view pages just like codeigniter CI caching instead of cache whole page i would like to different pages for logged in users and not logged in users so could someone please tell me is there any view page caching system for codeigniter or db query caching is best above all.

A: 

Check out MP_Cache library for CI, it's a way to cache parts of pages.

Compared to DB caching:

  • Reusable. Some parts (like your site menu’s) is the same on every page and probably doesn't need to be cached for each individual page.
  • You only have to delete it once after a change was made to any part of it and not all the cache for every page that uses the changed information.

Compared to output cache:

  • Caching portions of a page isn’t a problem.
  • Different cache for different uses of a function aren’t a problem as you can add a variable in the cache “name”

You can read more about it on its CI Wiki Page.

Other libraries include: Fragment Caching Library and Sparks (un-supported).

Mitchell McKenna