Caching based on content blocks |
[eluser]Unknown[/eluser]
Hello everyone. I'm looking for a way to cache my output, before gathering data. CI seems to support per-page caching only, which won't do in this situation. Imagine a contentpage, which contains various blocks. Each block has it's own template and thus each block has its own cache with it's own lifetime. I've thought of the solution below, and I'm quite content with its functionality. What bothers me is the fact that I need to call and check for cache in every template-returning method. The question: can anyone think of a way to automate this call? Code: <?php Thanks in advance
[eluser]Crafter[/eluser]
You can try creating an extended Controller library and create your actual controllers to extend the extended controller. In your libraries : Code: class My_Controller extends Controller { In your controllers directory : Code: class My_application_controller extends My_Controller {
[eluser]adamp1[/eluser]
If you have a look on the forums I remember seeing a cache library. What it did was let you cache objects and such to files with a keyname. You could then pull them back out of cache to output. Sadly I cannot find the library or the post about it atm. This would do what you wanted though I believe.
[eluser]Sarre[/eluser]
I think you may be referring to Al James' Sparks Library. He also made another cache library. greetz
|
Welcome Guest, Not a member yet? Register Sign In |