Appologies for unclear title. I don't really understand the problem I'm facing.
My system: PHP 5.2.1, Win2K, Apache 2, MySQL 5 (local - problem is same on my live site running php 4.3.9, Linux, Apache 2). Various browsers.
No errors are reported (set to ALL and STRICT) with my problem.
To describe the problem a little more:
The symptoms - very slow page load. I can see the page reloading simply by observing the 'progress' bar in any browser. It will get to about 90% and then drop to 0, then get to about 90% etc. It is clearly loading the page more than once (well apparently). Otherwise, the scripts run with no problems.
The problem (I think). In an attempt to debug this problem, I've placed a function at the very very top of my first script which sends the REQUEST_URI reference and a timestamp to a text file. Inside some of the scripts in the page, I've placed similar functions to record some variables and arrays to the same text file. I've placed a third function at the very end of the last script on my page (ie the footer).
When I load a single page, the log file I created, shows a little more what is happening. The REQUEST_URI reference first says the page that I wanted (eg /home). Then i get something like /mycss/default.css as the file which is loaded. The odd thing is that the CSS files are all loaded inside the header which is included after the first script is loaded.
Another oddity is that I include about 3 or 4 standard CSS files in each page and this problem never occurs with them. I have a simple script which changes the CSS files included depending on user preference and these extra files are the only ones with the problem. Incidentally, it's not just CSS but also image and JS files.
I also checked the problem by having a session variable increment each time the page was loaded. For one load on one page, I got 27 counts!!! It seems that the script passed over the $_SESSION['page_count']++ 27 times! (it isn't in a loop by the way).
I actually managed to reduce that count by using absolute path references on some images. But I don't understand why that had an impact.
So the crux of my problem (appologies for long explanation!) - I can see the impact and I've tried very hard to determine the cause. I think I have the cause but I don't know the solution.
As you can see I'm getting very stuck and the performance hit is pretty huge. I'd be very very grateful for any help! Thanks in advance.
My system: PHP 5.2.1, Win2K, Apache 2, MySQL 5 (local - problem is same on my live site running php 4.3.9, Linux, Apache 2). Various browsers.
No errors are reported (set to ALL and STRICT) with my problem.
To describe the problem a little more:
The symptoms - very slow page load. I can see the page reloading simply by observing the 'progress' bar in any browser. It will get to about 90% and then drop to 0, then get to about 90% etc. It is clearly loading the page more than once (well apparently). Otherwise, the scripts run with no problems.
The problem (I think). In an attempt to debug this problem, I've placed a function at the very very top of my first script which sends the REQUEST_URI reference and a timestamp to a text file. Inside some of the scripts in the page, I've placed similar functions to record some variables and arrays to the same text file. I've placed a third function at the very end of the last script on my page (ie the footer).
When I load a single page, the log file I created, shows a little more what is happening. The REQUEST_URI reference first says the page that I wanted (eg /home). Then i get something like /mycss/default.css as the file which is loaded. The odd thing is that the CSS files are all loaded inside the header which is included after the first script is loaded.
Another oddity is that I include about 3 or 4 standard CSS files in each page and this problem never occurs with them. I have a simple script which changes the CSS files included depending on user preference and these extra files are the only ones with the problem. Incidentally, it's not just CSS but also image and JS files.
I also checked the problem by having a session variable increment each time the page was loaded. For one load on one page, I got 27 counts!!! It seems that the script passed over the $_SESSION['page_count']++ 27 times! (it isn't in a loop by the way).
I actually managed to reduce that count by using absolute path references on some images. But I don't understand why that had an impact.
So the crux of my problem (appologies for long explanation!) - I can see the impact and I've tried very hard to determine the cause. I think I have the cause but I don't know the solution.
As you can see I'm getting very stuck and the performance hit is pretty huge. I'd be very very grateful for any help! Thanks in advance.
Comment