CodeIgniter Forums
Config autoloading skipped when using cache - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Config autoloading skipped when using cache (/showthread.php?tid=2385)



Config autoloading skipped when using cache - El Forum - 08-02-2007

[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


Config autoloading skipped when using cache - El Forum - 08-02-2007

[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.


Config autoloading skipped when using cache - El Forum - 08-02-2007

[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