Issue with caching (0.91 branch)

edited January 2011 in Bug Reports
First of all; I started using FUEL 3 days ago after I've been using CI for a while. I must say, I think I'm in love with FUEL. I think it's really flexible and easy to start with.

Although FUEL seems quite fast, I'm interested in it's caching capabilities. Coming from CI, I'm used to doing something like this:

$this->output->cache(100);

This seems to work at first, but when I load the view a second time, I get the following error:
Fatal error: Class 'CI_Controller' not found in C:\...\fuel\codeigniter\core\CodeIgniter.php on line 210

I checked, and the BASEURL seems just fine. May this be caused by my ignorance of not using FUEL's caching mechanism (I couldn't find how to use it) or is this a bug?

Comments

  • edited 4:00AM
    Thanks for the interest and we are glad you find it useful.
    With regards to your issue, I actually think that may be a CI 2.0 bug. I just updated my local repo yesterday to the latest CI 2.0 (for the next version, 0.92) and am not seeing that problem. However, the version 0.91 I have locally does throw that error. I'd be curious if you update your local fuel/codeigniter folder with the latest codeigniter system folder, if the problem continues. If it does, then I'll need to dig further.
    https://bitbucket.org/ellislab/codeigniter/

    Also, there are some different cache settings and ways to optimize pages using some built in cache features in FUEL. There is a "use_page_cache" setting you can put in your fuel/application/config/MY_fuel.php page which says where to use the cache (options are "cms", "views", TRUE, FALSE). The assets library also provides you the ability to combine css and javascript files, strip whitespace and gzip them to reduce download time (must have writable assets/cache directories).

    http://getfuelcms.com/user_guide/general/configuration
    http://getfuelcms.com/user_guide/libraries/asset

    Also, if you are logged into FUEL, the general page load time is going to be longer because it has to render some extra javascript for inline editing. Regular users do not see that.
  • edited 4:00AM
    Thank you for your quick and helpfull response. Updating the CI code to the latest did indeed fix the issue! The actively maintained forum gives me yet another reason to continue loving FUEL :)

    Your suggestions on using the use_page_cache setting look promising, I'll look into that in the next few days. Is there also a way to have the ttl differ per page / controller?
  • edited 4:00AM
    There currently isn't an easy way to set the cache TTL per page when using FUEL's caching. The FUEL caching kicks in only on pages generated by the admin (if their cache setting for that page is checked to yes), or if you are using the opt-in controller method and they get routed through the fuel/modules/fuel/controllers/page_router.php controller. Pages using the regular CI controller-> view method, can use the built in output cache like you were doing above.

    More on opt-in controller if you haven't seen it yet:
    http://www.getfuelcms.com/user_guide/general/opt-in-controllers

    Ahh... on more thing I forgot to mention. With the latest version of the CI 2, they've changed where the default cache and logs folder is. It is no longer in the system (or for FUEL, codeigniter) folder but now exists in the application directory. However, they now provide a cache_path setting in the application/config/config.php file that you can use to change it back.
Sign In or Register to comment.