• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Config autoloading skipped when using cache

When CI displays a cached page, it loads the config.php but none of the application's auto loaded configuration files.

This pose a problem if there are things need to be done before the cache display(using hooks or whatever) that depend on auto loaded configuration files

That would add unnecessary overhead for most people. There's only one hook prior to the caching mechanism (pre_system), so there's nothing else loaded that libraries and modesl can be pre-loaded against. They need to be assigned to the controller instance. How do you see this being solved?

I would suggest your pre-system logic not depend on autoloaded resources. You can always access the autoload.php file directly, if you need.

My specific problem is that I set (for various reasons) the $config["site_url"] inside a separate auto-loaded config file.
And since it is not loaded automatically, the cache get broken, because it depends on correct $config['site_url'] .

I temporarily solved this by modifying Codeingiter.php to autoload needed config files before using the cache, but I hope to get a more standard solution

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.