CodeIgniter Forums

Full Version: Config autoloading skipped when using cache
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Jumper[/eluser]
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

El Forum

[eluser]coolfactor[/eluser]
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.

El Forum

[eluser]Jumper[/eluser]
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