![]() |
Hello, I've recently been having very long loading times for my CodeIgniter pages. Even without database queries, it takes > 16 seconds to load a simple view. PHP memory_limit etc. is set to > 4 GB. I also have the problem with both Xampp and Wamp Server (Xampp currently installed). I'm slowly running out of ideas as to what else could be causing it. Do you have any ideas?
Quote:Bootstrap: 23.83 ms I don't have any filters or anything like that active. Controller is very simple: PHP Code: public function privacy() View contains simple html (static). If I write a PHP script that performs certain database queries, it runs in a few milliseconds also local. The site is extremely fast on the live system (Ubuntu server). So it must be something local. But I don't know what else I can check.
Check if your baseURL is correct.
https://codeigniter.com/user_guide/insta...-site-uris
Yes, I have configured the baseURL to a different one by .env with trailing slash:
app.baseURL = 'http://website.intern/' It also makes no difference if I set app/Config/App.php public string $baseURL to the Dev Base URL as well. Because the .env has priority. I tested it anyway. php spark phpini:check is also fine. I use CodeIgniter v4.5.2.
Okay.
> View: sites/privacy.php: 16,265.88 ms The rendering of the view file took long time. Check the contents.
You can try turning on development mode, then on the toolbar make sure Hot Reload is not active.
I once experienced something similar and it turned out that was the cause.
@xxxx[{::::::::::::::::::::::::::::::::>
Hello everyone! Thanks for your answers! Hot reload is disabled. I don't see any errors in xampp/apache/logs/error.log.
Even if I write the following in the view: Code: <h1>Test</h1> I still get 8.14 seconds loading time for this view. I just don't understand it. Hard drive is a fast SSD.
As a test, I had set the view code to
Code: <h1>Test</h1> So only this static HTML. Still > 8.4 seconds. I just tested whether this was the case with a brand new version of CodeIgniter. And found out: No. It is incredibly fast, as you would expect. So I went and recreated the whole project and copied the relevant data controllers, models, views, etc. over. Only replaced the adjusted config files. The only thing I didn't restore was: https://github.com/mihatorikei/codeigniter-vitejs So I suspect it had something to do with it. Do you have any recommendations, perhaps outside of Vite, on how to ideally reduce JS and CSS size?
> Do you have any recommendations, perhaps outside of Vite, on how to ideally reduce JS and CSS size?
This question should be on stackoverflow. or you can try the following package https://github.com/michalsn/minifier
@xxxx[{::::::::::::::::::::::::::::::::>
Minify CSS Online
Minify JS Online unminify What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |