Best methods to SPEED Up your Sites

Discussion in 'Site & Server Administration' started by apachehtaccess, May 31, 2007.

  1. #1
    List for Faster Web Page Methods
    1. Make fewer HTTP requests - Reducing 304’s with Cache-Control Headers
    2. Use a CDN
    3. Add an Expires header - Caching with mod_expires on Apache
    4. Gzip components
    5. Put CSS at the top
    6. Move JS to the bottom
    7. Avoid CSS expressions
    8. Make JS and CSS external
    9. Reduce DNS lookups - Use Static IP address, use a subdomain for static content.
    10. Minify JS - Refactor the code, compress with dojo
    11. Avoid redirects - Use internal redirection with mod_rewrite, The correct way to redirect with 301
    12. Remove duplicate scripts
    13. Turn off ETags - In htaccess:
      FileETag None
      Header unset ETag
      Code (markup):
    14. Make AJAX cacheable and small


    Sources & References

     
    apachehtaccess, May 31, 2007 IP
    abdussamad and dannet like this.
  2. chilli_source

    chilli_source Active Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #2
    very useful post, thanks!

    visited your blog also.. some great info in there :)
     
    chilli_source, Jun 1, 2007 IP
  3. blackdisc

    blackdisc Peon

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i think it is best to get a good server
     
    blackdisc, Jun 1, 2007 IP
  4. apachehtaccess

    apachehtaccess Guest

    Messages:
    82
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I bet a $500 BSD/linux server configured with the above tips it would be noticeably faster than a site on an unoptimized $20,000 non-apache server. Add the hosting, DNS, Static IP's, bandwidth, etc., and you could do it for around a cool $300/yr. $800 vs. $20,000 plus who knows what kind of huge amount of money companies and corporations waste every year for technology product/packaged "solutions" instead of know-how and best-practices. Still its tough to learn everything mentioned in the list, but its worth it when your sites are noticeably-almost instantaneously quick.
     
    apachehtaccess, Jun 1, 2007 IP
  5. apachehtaccess

    apachehtaccess Guest

    Messages:
    82
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    And its all good for the entire Internet!
     
    apachehtaccess, Jun 1, 2007 IP
  6. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Nice post. Must be stickied here!

    Repped.
     
    inworx, Jun 1, 2007 IP
  7. zonzon

    zonzon Peon

    Messages:
    100
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think that some webmasters must read your post! nice links too :)
     
    zonzon, Jun 1, 2007 IP
  8. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Could you clarify this more? Do you mean mod_gzip? Because IMHO this is for reducing bandwidth usage, not for speeding things up. In certain scenarios (lots of data which is highly comrpessable) I guess it would speed things up, but usually it slows things down. This is because of the overhead involved: your server has to gzip the page before sending it, and then the users machine has to decompress it. Granted, the cpu load for the user will be unnoticable, but not so on the server if you're serving lots of requests.

    Your other tips though seem to be quite useful, so maybe I'm mistaken on the above, would like to hear your input on it.
     
    turiel, Jun 1, 2007 IP
  9. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #9
    gzip lowers bandwidth usage:

    It compresses the transfers, thus less bandwidth usage on owner's server but since the bandwidth is less, the size of page is less as well. Thus, the page is automatically speeds up!
     
    inworx, Jun 2, 2007 IP
  10. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Right but you're forgetting the performance overhead from actually compressing the page before transfer. Compressing a page takes CPU time, on both the client and server. Its negligible on the client side but on the server side where hundreds of pages are being compressed a second, it would really slow things down, afaik.
     
    turiel, Jun 2, 2007 IP
  11. Spartan_Strategy

    Spartan_Strategy Peon

    Messages:
    197
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Anyone have similar info for Windows based hosting?
     
    Spartan_Strategy, Jun 2, 2007 IP
  12. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Fix it by using Linux :p

    You may possibly have been looking for a more serious answer but hey, its still a perfectly valid solution :p
     
    turiel, Jun 2, 2007 IP
    apachehtaccess likes this.
  13. BlindCat

    BlindCat Banned

    Messages:
    415
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Should i enable gzip in my phpbb forum? Will that help to speed up the forum?




     
    BlindCat, Jun 2, 2007 IP
  14. ndreamer

    ndreamer Guest

    Messages:
    339
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #14
    gzip is done on the server side it will actually increase server load however it will decrease the time it takes your users to download the page and save you some bandwidth.

    if your forum is slow you need to look in to php caching methods
    apc is great
    http://forums.digitalpoint.com/showthread.php?t=352387
    or configuring apache, php or removing phpbb plugins that may be effecting your server load.
     
    ndreamer, Jun 2, 2007 IP
  15. damchi

    damchi Peon

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Some very good info in this thread. Thanks :)
     
    damchi, Jun 2, 2007 IP
  16. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Well, for me. My customers and users are far more important than CPU usage. So, a little high load wont be a problem. Also, if you use single processor, you should not host more than 150 sites at max.

    On a Quad core 600 is the max. So, assume the CPU Load according to that. My servers have load of 0.05 - 0.75 of max. 2

    Other one with gzip enabled with same number of sites hosted has max. load of 1.25 of max. 4.
     
    inworx, Jun 3, 2007 IP
  17. blue_angel

    blue_angel Well-Known Member

    Messages:
    1,174
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #17
    very useful post, thanks!
     
    blue_angel, Mar 30, 2008 IP
  18. apachehtaccess

    apachehtaccess Guest

    Messages:
    82
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #18
    No problem.. these make such a huge noticeable difference.. I wish the whole net was as fast as my site.
     
    apachehtaccess, Mar 30, 2008 IP
  19. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #19
    I don't agree. Before quad-cores and even HT's there was the plain old Xeon and Pentiums. Plenty of hosts handled hundreds of sites on a single CPU.

    I personally have what's now considered ancient P4 3.2ghz HT BSD server that's been running for 5 years. I practice good security and maintain my server with updates. 5+ years and it dishes out 500+ GB of bandwidth per month and hosts about 50 of my most active sites with no problems. Load is normally under .3.

    Most people over do it on the processor and don't spend enough on optimizing the server.

    I would like to add 1 extra tip.

    Make sure to run a php accelerator like eaccelerator. It can certainly speed up the site and do wonders with server load.
     
    RectangleMan, Mar 30, 2008 IP
  20. apachehtaccess

    apachehtaccess Guest

    Messages:
    82
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #20
    I agree Rect, at first I was all about minimizing the traffic, but at this point I usually opt to disable gzip compression server-side and pass on dynamically generated or database-driven content in favor of static when possible.

    In 5 years or so the bandwidth won't be an issue, and processing speeds are also doing what they do.

    Still, the experience from speeding up your site and servers is invaluable.
     
    apachehtaccess, Mar 30, 2008 IP