Saturday, July 25, 2009

Best Practices for Speeding Up Your Web Site - No 404s

HTTP requests are expensive so making an HTTP request and getting a useless response (i.e. 404 Not Found) is totally unnecessary and will slow down the user experience without any benefit.

Some sites have helpful 404s "Did you mean X?", which is great for the user experience but also wastes server resources (like database, etc). Particularly bad is when the link to an external JavaScript is wrong and the result is a 404. First, this download will block parallel downloads. Next the browser may try to parse the 404 response body as if it were JavaScript code, trying to find something usable in it.

Saturday, July 18, 2009

Best Practices for Speeding Up Your Web Site - Reduce Cookie Size

HTTP cookies are used for a variety of reasons such as authentication and personalization. Information about cookies is exchanged in the HTTP headers between web servers and browsers. It's important to keep the size of cookies as low as possible to minimize the impact on the user's response time.

For more information check "When the Cookie Crumbles" by Tenni Theurer and Patty Chi. The take-home of this research:



     
  • Eliminate unnecessary cookies
  •  
  • Keep cookie sizes as low as possible to minimize the impact on the user response time
  •  
  • Be mindful of setting cookies at the appropriate domain level so other sub-domains are not affected
  •  
  • Set an Expires date appropriately. An earlier Expires date or none removes the cookie sooner, improving the user response time