My PHP Application's index page is taking more than 30 secs to load. I am using PHP version - 8.1.18 on RHEL 8.6 and Apache v2.4.4 The index.php page contains 43 javascripts included through the <script> tag. These js files call a portal.php file which includes 15 other php files using include_once. One of the included file is responsible for database connection. The portal.php file contains a parametrized switch case which calls one or multiple included php files. A total of 27 requests are been simulataneously made through the javascript files to portal.php and the response is fetched. My observation is the response from portal.php is taking a lot of time to respond which in turn results in the performance issue. Please advise on how to increase performance of my index.php page.
Until now I have tried: Optimizing and minification of all js files. Installed opCache. Checked all the database queries whether they are taking time to load which is not happening. defer and async for javascript loading None of the above has worked.
<?php // top of your php script require_once('file_1.ext'); require_once('file_2.ext'); require_once('file_3.ext'); require_once('file_4.ext'); // and after , put your processing code.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)