how can i optimize speed of loading a page?

Discussion in 'PHP' started by mehdiali, Nov 7, 2007.

  1. #1
    hi everyone?
    i have a page that it's size is 50kb(for example)
    and it contains text,images,flash items
    and has transactions with a mysql database(a common page).
    so how can decrease time of page loading and page transactions?
    i think most important thing is image loading(regardless of flash items).
    thank you in advance.
     
    mehdiali, Nov 7, 2007 IP
  2. yourihost

    yourihost Well-Known Member

    Messages:
    1,708
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    115
    #2
    Use PhotoShop to make your images friendly for websites.
     
    yourihost, Nov 7, 2007 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    the better way is by using AJAX, div containers, blah blah, etc...
     
    bartolay13, Nov 8, 2007 IP
  4. wrestler

    wrestler Guest

    Messages:
    1,087
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    use photo shop for your designing.
    that's the best method.
     
    wrestler, Nov 8, 2007 IP
  5. foreststone

    foreststone Peon

    Messages:
    1,355
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    make the images as small size as possible
     
    foreststone, Nov 8, 2007 IP
  6. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Geez guys this is a PHP section and you all recommend using photoshop ;)

    There are numerous options here

    - Gzip the content on your page using PHP output buffering
    - Cache the page to disk/memory for a time period so you only hit the database the first time the page is loaded and never again.
    - Host your images on a separate domain or server. HTTP 1.1 has at most 2 concurrent connections so if you have 2 servers loading a user can have 4 connections at a time.
    - Use etags and expiry headers on your images so they are cached in the User agent and only hit your server once.

    Some of these arent that easy to implement but all will have a MASSIVE effect on your load time :)

    Hope this helps
     
    tonybogs, Nov 8, 2007 IP
  7. redlorry919

    redlorry919 Peon

    Messages:
    384
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If it's doing a lot of mysql queries you might to also make sure your db is optimised. Ensure also that SELECTS are not selecting *, only SELECT the fields required. Make sure any multiple table SELECTs are done via joins where possible.
     
    redlorry919, Nov 8, 2007 IP
  8. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #8
    Agree with most. About gzipping though, most web servers already do that. So you don't need to do that on script level.
     
    phper, Nov 8, 2007 IP
  9. yooozy

    yooozy Well-Known Member

    Messages:
    1,153
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    170
    #9
    use coockies to evade reload the same item twice
    so your page load heavily only for the first time in the user's browser then it'll be super lite
     
    yooozy, Nov 8, 2007 IP
  10. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #10
    I'm not sure what 'item' you are referring to there. But in general, this is not true. Using cookies will just add extra overheads, because every time the browser sends a request to the server, all cookies for that domain (and path, if specified) will also need to be sent.
     
    phper, Nov 8, 2007 IP
  11. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #11
    nico_swd, Nov 8, 2007 IP