Hi,

I have uploaded a web site on the server then I hav tested it on the browser but it is taking a lot of time to load its contents. I dont have anything heavy in the site, does anybody know any solution to overcome this problem??

Please reply.
Take care.
Coolmind

sometimes it happens when your mysql query goes in infinite loop.
carefully check all the queries.

Do you have any js-based analytics or advertising etc.? These can really slow down sites - I had to remove some of them from mine.

Is the slow load experienced on every computer or on every browser?

Have you pruned the page to various stages of undress to see which component is causing the delay? As prev. mentioned,loops (especially nested loops) may be the cause of your woes.

Do you have hundreds of people viewing your site at any given time? Is your server up to the task?

You could time certain procedures with microtime(), to give you a list:

$start = microtime(true);

//YOUR PROCEDURE e.g. loop

$end = microtime(true);

$elapsed = $end - $start;

echo "Procedure 1 = {$elapsed} seconds";

//repeat as necessary

What system is the website running on?

You can use the following commands to find this out:

echo "Site Software: ".$_SERVER["SERVER_SOFTWARE"]."<br />";
echo "Proccessors: ".$_SERVER["NUMBER_OF_PROCESSORS"];

If the proccessor returns something silly like 1 then that might be an issue (these things can take allot of proccessing) but this wouldn't be the main issue.

Does your site finish loading or does it take soo long you give up? If this is the case AND the site software is Windows IIS then it could mean you need to configure IIS to accept PHP extensions.

Be sure that all images, style .css files and .js files load fast. Add some code to your index.php file to see <URL SNIPPED>server-side page generation time. Loading time, data transferring speed and page generation time are different things.

Hi There,

I am using .htaccess file in my site. I have defined .htaccess rules for each file seprately, does this slow slow down the loading speed of the site??

Please reply
Coolmind

Have you tried renaming htaccess to something else and then testing the page? I notice you're not in any rush for this!

Hi Ardav,

Thank you for your help. I have tried renaming .htacess file to htaccess and I think the site is loading quick now. Actually my .htaccess file was hidden on my server.

I have just renamed .htaccess file to htaccess then upload on my server, any suggestion?

Thank you
Take care,
Coolnmind

Your .htaccess file may still be there if you've just uploaded another file called htaccess. I was thinking of renaming it to, say, htaccess.txt in situ, i.e. on the server in your FTP view. I don't know enough about htaccess to be able to advise you, but it seems like the obvious culprit if you've got nothing else in your files that could account for the slow loads. Have you contacted your host to ask them for advice? It could be that you're on a shared host with some naughty people who are serving mp3s and videos and slowing everybody down.

HI Ardav,

I don't think that .htaccess file is slowing down the loading. I have renamed the .htacess but I still see the same result.

I can not figure out what is the problem. Can you check the site for yourself.

http://www.freelanceiq.net/

Take care,
Coolmind

I checked your site and when viewing it, the page is almost a Megabite in size. I would suggest using the flush() function immediately after every javascript file is included.

Thank you for your help.

why do I have to use flush() in every javascript file. What if I put it at the end of all the files.

Coolmind

may be everything is taken from database at the instant u open the website make sure tht there is little oad on database while uploading

Thank you for your help.

why do I have to use flush() in every javascript file. What if I put it at the end of all the files.

Coolmind

Well the flush() function sends the currently processed information to the browser instead of waiting for the entire page to be processed. And these flush() functions need to be in the main php file which the user is viewing from the url. It can be handy for very large pages like yours and although the overall result will take just as long to load, the user can see parts of it at a time as it is being processed if the flush() function is being used.

This article has been dead for over six months. Start a new discussion instead.