• Home
  • Services
  • Profile
  • Portfolio
  • Contact
  • Links
  • Blog
  • Archives
  • Sitemap
Subscribe: Posts | Comments | E-mail
  • Ajax
  • Design
  • Development
  • Freebies
  • IT News
  • Miscellaneous
  • Programming
  • Tutorials
  • Web 2.0

Bali Web Design

Posted on May 21, 2009 - by ruby

Website Optimization Best Practices, speed up your website load

Ajax Development Featured

Once i have performance issue in a website project i am working at, and i have wasted hours of my time to fix it up both in the server-side and client-side, for future checklist i searched on web and found great list of best practices to speed up our web page load at yahoo developer network.

Below are the summary:

  1. Minimize HTTP Requests, this can be done with the following practices:
    • Combined files are a way to reduce the number of HTTP requests by combining all scripts into a single script
    • CSS Sprites, combined your background image into a single image and use CSS property to control the position of image segment
    • Image maps combine multiple images into a single image
    • Inline images use the data: URL scheme to embed the image data in the actual page
  2. Use a Content Delivery Network
  3. Add an Expires or a Cache-Control Header:
    • For static components: implement “Never expire” policy by setting far future Expires header
    • For dynamic components: use an appropriate Cache-Control header to help the browser with conditional requests
  4. Compress HTTP text response with Gzip Components (text, html, json, xml)
  5. Put CSS/stylesheets declarations at the Top
  6. Put client side scripts at the bottom, some scripts can be placed at the bottom but some may not, so use it as neccessary
  7. Avoid CSS Expressions, since it is evaluated more than we expect: on load, resize, scrolled, and even on mousemove
  8. Make JavaScript and CSS External, take the benefit of browser caching mechanism
  9. Reduce DNS Lookups in server’s settings
  10. Minify JavaScript and CSS, you can use JSMin and YUI Compressor to achieve this goal
  11. Avoid Redirects, one of the common mistaken is missing a trailing slash (/) from a URL, i.e: http://www.domain.tld/directory will be 301 redirected to http://www.domain.tld/directory/
  12. Avoid scripts duplication
  13. Configure ETags, Entity tags (ETags) are a mechanism that web servers and browsers use to determine whether the component in the browser’s cache matches the one on the origin server.
  14. Make Ajax Response Cacheable, some rules should apply also to ajax are: Add an Expires or a Cache-Control Header, Compress HTTP reponse with Gzip component, Reduce DNS Lookups, Minify JavaScript, Avoid Redirects, Configure ETags
  15. Flush the Response Buffer Early, in php there is flush(), and response.flush in asp
  16. Use GET for AJAX Requests, because POST method is implemented in the browsers as a two-step process: sending the headers first, then sending data.
  17. Post-load Components, Load page element only when it is neccessary or after the top priority elements is loaded. Have a l ook at YUI Image Loader, YUI Get Utility, or jQuery Lazy Load
  18. Preload Components
    • Unconditional preload – as soon as onload fires, you go ahead and fetch some extra components.
    • Conditional preload – based on a user action you make an educated guess where the user is headed next and preload accordingly.
    • Anticipated preload – preload in advance before launching a redesign.
  19. Reduce the Number of DOM Elements, means you need to optimize your markup, do not use new element if you can solve the issue in different ways
  20. Split Components Across Domains, Splitting components allows you to maximize parallel downloads.
  21. Avoid using iframes (and frames either)
  22. No 404s, because the HTTP request is expensive
  23. Reduce Cookie Size, It’s important to keep the size of cookies as low as possible to minimize the impact on the user’s response time
  24. Use Cookie-free Domains for Components, You should make sure static components are requested with cookie-free requests. Create a subdomain and host all your static components there.
  25. Minimize DOM Access:
    • Cache references to accessed elements
    • Update nodes “offline” and then add them to the tree
    • Avoid fixing layout with JavaScript
  26. Develop Smart Event Handlers, attach event handler via parent elemnt wherever possible
  27. Choose
    over @import for stylesheets
  28. Avoid Filters, mostly comes when dealing with IE6, YDN recommended using PNG8 which working fine in IE, but for me better shoot the IE6 with a machine gun (a lot headache cos of IE6 already)
  29. Optimize Images: Try converting GIFs to PNGs, Run pngcrush (or any other PNG optimizer tool) on all your PNGs, Run jpegtran on all your JPEGs
  30. Optimize CSS Sprites:
    • Arranging the images in the sprite horizontally as opposed to vertically
    • Combining similar colors in a sprite helps you keep the color count low
    • “Be mobile-friendly” and don’t leave big gaps between the images in a sprite.
  31. Don’t Scale Images in HTML
  32. Make favicon.ico Small and Cacheable
  33. Keep Components under 25K
  34. Pack Components into a Multipart Document

Check out the original article at YDN

Share this article:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • LinkedIn
  • MySpace
  • Ping.fm
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • TwitThis
This entry was posted on Thursday, May 21st, 2009 at 23:28 and is filed under Ajax, Development, Featured. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

5 Comments

We'd love to hear yours!



  1. Visit My Website

    June 1, 2009

    Permalink

    coffeecoders.de» Blog Archive » Website Optimization Best Practices said:

    [...] Link: http://www.chazzuka.com: Website Optimization Best Practices, speed up your website load [...]



  2. Visit My Website

    June 11, 2009

    Permalink

    Cody said:

    Excellent tips….I’ve heard of some of them, but you have a lot of them! Thanks!



  3. Visit My Website

    June 13, 2009

    Permalink

    ren said:

    these information are the same if you install yslow from yahoo in firefox.



  4. Visit My Website

    June 24, 2009

    Permalink

    indra said:

    great list..
    just adding, reduce grabbing images from outbound url,
    that one can also minimize HTTP requests



  5. Visit My Website

    August 21, 2009

    Permalink

    Website design said:

    I just browsed through the original post it was too long, yours is nice and cut short. also thanks for giving the original post link.
    Was quite useful.

    Also you or yahoo have not mentioned about the flash header…

    Austin



Leave a Comment

Here's your chance to speak.

  1. Name (required)

    Mail (required)

    Website

    Message

  • Ad Ad Ad Ad
  • Recommended Links

  • Featured News

    • PHP Class Create Short URL via TinyURL, Is.gd, Hex.io, Tr.im & Bit.ly API by webmaster on September 24, 2009
    • How to embed plurk status in wordpress blog by ruby on September 12, 2009
    • Website Optimization Best Practices, speed up your website load by ruby on May 21, 2009
    • Prism Firefox Extension, bring your web apps to the desktop by ruby on May 11, 2009
    • Troubleshoots During Migration by webmaster on March 7, 2009
  • Latest Entry

    • PHP Class Create Short URL via TinyURL, Is.gd, Hex.io, Tr.im & Bit.ly API
    • How to embed plurk status in wordpress blog
    • Scripty2 the successor of script.aculo.us
    • Social Network Icon Pack
    • jQuery validation engine, jquery inline form validation
  • Tag Cloud

    • Actionscript advertorial Ajax API best practices chat Classic ASP CMS CSS Design Development facebook firefox Flash flickr Freebies gmail HTML icons Javascript Jobs jQuery jQuery Plugins Library Lightbox Mootools news Personal PHP plurk prism Prototype regex regular expression Scriptaculous SEO Tutorial twitter Web 2.0 Wordpress Works YUI
  • Most Popular Posts

    • { 80 } ResponsesPHP ajax login form using Jquery
    • { 79 } Responsesphp ajax tutorial create ajax based login form using jquery
    • { 57 } ResponsesASP Classic Programming Still Alive
    • { 50 } Responses63+ best practice to optimize PHP code performances
    • { 37 } ResponsesVideobox: Lightbox for videos
© 2007 - 2010 Bali Web Design all rights reserved
Powered by wordpress Theme by woothemes