Status
Not open for further replies.

r4myy

Active Member
155
2010
1
0
Can someone give me some tips on how to load a page faster

Ive optimized my mysql queries

i added a flush() to the middle of the page to make the page show before its all done loading (not sure if this is a good idea or not)

it works but when it gets to the flush() it kinda stops for a second then continues

any better way of doing this?
 
17 comments
Can someone give me some tips on how to load a page faster

Ive optimized my mysql queries

i added a flush() to the middle of the page to make the page show before its all done loading (not sure if this is a good idea or not)

it works but when it gets to the flush() it kinda stops for a second then continues

any better way of doing this?



Ummm how about gettin a better host? dont you think thats why its slow?
 
Start with optimizing your server and mysql. Maybe there is a problem?
This is an awesome blog:

Happy Reading ;)
Thanks for the link, ill check it out

Ummm how about gettin a better host? dont you think thats why its slow?
well thats part of the reason but i just wanted to get some tips to make the code faster

ill check if its an image thing too, thanks guys
 
add your own Image site on same domane and let all member us that for post and make sure all site you have link LE on your site are running and have the control of your bord N01 get a monster server =)
 
Firstly do not use flush()

at the top of your site make sure your starting you output_buffer with gzip compression

Take a look at this caching function without gZip.. before printing contents you can use the ZLIB functions like gzcompress http://uk.php.net/manual/en/function.gzcompress.php
http://www.coderprofile.com/networks/source-codes/170/ajax-when-to-use-it/source-code

Secondly! What system are you actually using, your own or pre made.

--
Design:
Compress your external files like css / js into one file!, so if you have style.css,reset.css put the rest at the top of style and just load the style.css..

Same with javascript.

Reduce the amount of images you have on your page, thats not css images im talking about <img src.../>

These are just some things you can do, theres more advanced methods such as CatchControlling and so on but the about will get you a little faster
 
litewarez answer is spot on.
The answers by mrsandvik, bxflow and Lock Down are a last resort. I have no idea why PBI NetWork suggested that.

Ya it can depend on you server but generally it's the script and site that's the problem. Having lots of images is the main killer. Especially large ones. eg using one giant large image as a background is a no-no. The code like html, js and css is rarely the problem unless you have something like a blog and you've added loads of addon's which all work independently and need their own scripts loaded. This is like loading several different sites as they weren't designed together. By combining them together it's like having them as one site again and getting your speed back.


To be honest if you were to give a link to your site most of us would be able to tell you the exact cause of the problem. For all we know it might be loading fine and your internet connection is crap

EDIT if it's a custom script or beta mod their could be an error in the script which is in a constant loop that needs to be fixed. You could try disabling them to see if that's the problem but giving us a link would be a lot easier.
 
Firstly do not use flush()
Took that off now

at the top of your site make sure your starting you output_buffer with gzip compression

Take a look at this caching function without gZip.. before printing contents you can use the ZLIB functions like gzcompress http://uk.php.net/manual/en/function.gzcompress.php
http://www.coderprofile.com/networks/source-codes/170/ajax-when-to-use-it/source-code
I have
PHP:
ob_start("ob_gzhandler");
on the top of the page

Secondly! What system are you actually using, your own or pre made.
My own


Design:
Compress your external files like css / js into one file!, so if you have style.css,reset.css put the rest at the top of style and just load the style.css..

Same with javascript.
Done

Reduce the amount of images you have on your page, thats not css images im talking about <img src.../>

These are just some things you can do, theres more advanced methods such as CatchControlling and so on but the about will get you a little faster
So is it faster if i use backgrounds in css instead of <img


I just updated the mysql queries too.. i think there were lots of unnecessary things in there (i think thats where most of the loading was)

Thanks a lot for the help
 
......
My own
......
Private Mesage me or Litewarez the site if you want and I'll let you know more. If you use FireFox you can use an addon called firebug. That will tell you all the files that are used to load a page and all the server request. It also tells you the time takes to download each file and their size. This gives a great indication of what causing the problem on your site as it's show in graph form. example from google below:

firebug_net.png
 
You've a shit load of adverts and their's an error in one of the advert codes that's killing your site. Your site has 101 requests. A typical site should have 10 - 30 which your site has but you've about 60 advert requests. Try removing the adverts as they seam to be causing issues. A lot of them are even failing to load as show below.

[slide]http://img84.imageshack.us/img84/3536/65842023.jpg[/slide]

Compare the above to the top half of the list which is your site and you'll see their clearly taking longer to load.

[slide]http://img203.imageshack.us/img203/3435/61990656.jpg[/slide]
 
just took the ads off

better now?

thanks a lot for the help btw

Excellent. On my computer you've just cut the load time by 60% and took 11 seconds off the load time. The site is now 40% smaller as well code wise. I'd have a look at adding different adverts if you really need them. The ones you had clearly didn't work right and were causing major problems.
 
Great, thanks a lot

I just put up those ads recently and i noticed that google wasnt crawling my pages as much lately, do you think this is why?
 
Great, thanks a lot

I just put up those ads recently and i noticed that google wasnt crawling my pages as much lately, do you think this is why?

Hard to say exactly but yes it definitely would have had an influence. Google will definitely prefer your site now. Glad it's all worked out now.

I hope this is a lesson to other as well not to jump to conclusions and go straight to blaming your host for issues such as a slow site when you don't know the cause of the problem.
 
Status
Not open for further replies.
Back
Top