Need tips to make website faster

Discussion in 'PHP' started by osho3, Apr 26, 2010.

  1. #1
    Need tips to make website faster
     
    osho3, Apr 26, 2010 IP
  2. Sergey Popov

    Sergey Popov Peon

    Messages:
    29
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sergey Popov, Apr 26, 2010 IP
  3. fierceservers

    fierceservers Peon

    Messages:
    338
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you mean by resource usage or by bandwidth? I'm assuming you mean the site in your signature?
     
    fierceservers, Apr 26, 2010 IP
  4. nezZario

    nezZario Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you're using PHP, check into APC (alternate PHP cache) if you control your servers. If you are on shared hosting, tell them to use APC or switch hosts.

    You can also look at yslow if you're looking @ load times
    http://developer.yahoo.com/yslow/
     
    nezZario, Apr 27, 2010 IP
  5. fierceservers

    fierceservers Peon

    Messages:
    338
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Caching won't always help if this is a network related issue. Also caching solutions won't work with suPHP so if your host is using this, good luck getting them to change.

    Waiting for TS to reply to know what kind of issue this is. TS can you also let us know what the load is on this particular server?
     
    fierceservers, Apr 27, 2010 IP
  6. majin22

    majin22 Peon

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yslow as mentioned above is one of the best tool that will help you speed up your site. try to minify all css and js files and to smush all images.

    You will definitely see a lot of difference after doing this things
     
    majin22, Apr 27, 2010 IP
  7. bytes

    bytes Peon

    Messages:
    39
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yslow is only client-side optimization, it is good, but we don't know anything about the project. What if on server side there is something like:
    
    $query1 = 'select * from table1';
    while($var = fetch($query1))
    {
        $query2 = sprintf('select * from table2 where field = %d',$var);
        while($var2 = fetch($query2))
        {
            $query3 = .......
        }
    }
    
    PHP:
    instead of join, in this case the site will never be fast no matter how good client optimization is. If I were the author, I'd start with DB optimization (slow_query_log in case of mysql), analyzing the most slow queries, rewriting queries, denormalizing tables if necessary. Second step is optimizing the algorithms, i.e. removing pieces of code like I posted above etc. And the final step is client optimization.

    Since it is impossible (and topicstarter woldn't do this) to post here full source code, I'd advise him to ask/hire someone for this task
     
    bytes, Apr 27, 2010 IP
  8. sarahk

    sarahk iTamer Staff

    Messages:
    28,901
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #8
    If it's site specific, as opposed to a general question of best practice, you should post a website review request in the reviews subforum.
     
    sarahk, Apr 27, 2010 IP
  9. s.ham

    s.ham Member

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    Most of the time is spend on retrieving data from db. So try to cache the data.
     
    s.ham, May 2, 2010 IP
  10. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #10
    roopajyothi, May 4, 2010 IP