CodeIgniter Forums
Config caching - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Config caching (/showthread.php?tid=88992)



Config caching - ltarrant - 12-18-2023

Hi,
I am in process of trying to optimise performance of a CI4 project.
I have been watching a few PRs on Github over the last few months and followed the Config Caching with interest.
(https://github.com/codeigniter4/CodeIgniter4/pull/7696)
I have tried uncommenting the lines currently in the index.php file. However, when I uncomment these I get an error 500 message with no error reporting and nothing in the logs.
Is there anything extra I need to do to trial the config caching?
Luke


RE: Config caching - Frederik - 12-18-2023

(12-18-2023, 08:58 AM)ltarrant Wrote: Hi,
I am in process of trying to optimise performance of a CI4 project.
I have been watching a few PRs on Github over the last few months and followed the Config Caching with interest.
(https://github.com/codeigniter4/CodeIgniter4/pull/7696)
I have tried uncommenting the lines currently in the index.php file. However, when I uncomment these I get an error 500 message with no error reporting and nothing in the logs.
Is there anything extra I need to do to trial the config caching?
Luke
You need to delete the Config Cache:
https://codeigniter.com/user_guide/concepts/factories.html?highlight=cache#how-to-update-config-values

Regards, Frederik


RE: Config caching - InsiteFX - 12-18-2023

You can also use the php.ini opcache.
Edit your php.ini file opcache is towards the end of it.


RE: Config caching - ltarrant - 12-27-2023

(12-18-2023, 09:59 AM)Frederik Wrote:
(12-18-2023, 08:58 AM)ltarrant Wrote: Hi,
I am in process of trying to optimise performance of a CI4 project.
I have been watching a few PRs on Github over the last few months and followed the Config Caching with interest.
(https://github.com/codeigniter4/CodeIgniter4/pull/7696)
I have tried uncommenting the lines currently in the index.php file. However, when I uncomment these I get an error 500 message with no error reporting and nothing in the logs.
Is there anything extra I need to do to trial the config caching?
Luke
You need to delete the Config Cache:
https://codeigniter.com/user_guide/concepts/factories.html?highlight=cache#how-to-update-config-values

Regards, Frederik

Thanks for reply. I deleted the Config Cache file. The page then loads OK on the first request but subsequent requests still see an error response with no detail or anything in the logs.


RE: Config caching - kenjis - 12-27-2023

Show error message for debugging.
Put the following code in the top of index.php:

PHP Code:
error_reporting(E_ALL);
ini_set('display_errors''1'); 



RE: Config caching - ltarrant - 12-28-2023

I'm getting the error:

Fatal error: Uncaught Error: Class "Kint\Renderer\AbstractRenderer" not found in /home/***********/vendor/codeigniter4/framework/system/Config/BaseConfig.php on line 64
Error: Class "Kint\Renderer\AbstractRenderer" not found in /home/***********/vendor/codeigniter4/framework/system/Config/BaseConfig.php on line 64


RE: Config caching - kenjis - 12-28-2023

Why do you use Kint in production?
Or didn't you set to production mode?


RE: Config caching - ltarrant - 01-08-2024

We don't but I was just testing this on the development server to see what performance increase it offers and if it worth looking at introducing to the production server.

(12-28-2023, 04:40 AM)kenjis Wrote: Why do you use Kint in production?
Or didn't you set to production mode?



RE: Config caching - kenjis - 02-19-2024

@ltarrant
Try this PR if you can.
https://github.com/codeigniter4/CodeIgniter4/pull/8558