Website Performance Best Practices by Yahoo!
7 questions you always wanted to ask a Yahoo boy
As a first step to implementing geographically dispersed content, don't attempt to redesign your web application to work in a distributed architecture. Depending on the application, changing the architecture could include daunting tasks such as synchronizing session state and replicating database transactions across server locations.
Attempts to reduce the distance between users and your content could be delayed by, or never pass, this application architecture step. This is the Performance Golden Rule. Rather than starting with the difficult task of redesigning your application architecture, it's better to first disperse your static content.
This not only achieves a bigger reduction in response times, but it's easier thanks to content delivery networks. A content delivery network CDN is a collection of web servers distributed across multiple locations to deliver content more efficiently to users. The server selected for delivering content to a specific user is typically based on a measure of network proximity.
For example, the server with the fewest network hops or the server with the quickest response time is chosen.
For start-up companies and private web sites, the cost of a CDN service can be prohibitive, but as your target audience grows larger and becomes more global, a CDN is necessary to achieve fast response times. Switching to a CDN is a relatively easy code change that will dramatically improve the speed of your web site.Practise or practice?
Add an Expires or a Cache-Control Header tag: A first-time visitor to your page may have to make several HTTP requests, but by using the Expires header you make those components cacheable. This avoids unnecessary HTTP requests on subsequent page views. Expires headers are most often used with images, but they should be used on all components including scripts, stylesheets, and Flash components.
Browsers and proxies use a cache to reduce the number and size of HTTP requests, making web pages load faster. A web server uses the Expires header in the HTTP response to tell the client how long a component can be cached.
This is a far future Expires header, telling the browser that this response won't be stale until April 15, Thu, 15 Apr This example of the ExpiresDefault directive sets the Expires date 10 years out from the time of the request. ExpiresDefault "access plus 10 years" Keep in mind, if you use a far future Expires header you have to change the component's filename whenever the component changes. Using a far future Expires header affects page views only after a user has already visited your site.
It has no effect on the number of HTTP requests when a user visits your site for the first time and the browser's cache is empty. Therefore the impact of this performance improvement depends on how often users hit your pages with a primed cache.
A "primed cache" already contains all of the components in the page. We measured this at Yahoo! By using a far future Expires header, you increase the number of components that are cached by the browser and re-used on subsequent page views without sending a single byte over the user's Internet connection. It's true that the end-user's bandwidth speed, Internet service provider, proximity to peering exchange points, etc.
But there are other variables that affect response times. Compression reduces response times by reducing the size of the HTTP response. The web server notifies the web client of this via the Content-Encoding header in the response. The only other compression format you're likely to see is deflate, but it's less effective and less popular. If you use Apache, the module configuring gzip depends on your version: There are known issues with browsers and proxies that may cause a mismatch in what the browser expects and what it receives with regard to compressed content.
Fortunately, these edge cases are dwindling as the use of older browsers drops off. The Apache modules help out by adding appropriate Vary response headers automatically. Servers choose what to gzip based on file type, but are typically too limited in what they decide to compress.
Most web sites gzip their HTML documents. It's also worthwhile to gzip your scripts and stylesheets, but many web sites miss this opportunity. Image and PDF files should not be gzipped because they are already compressed. Trying to gzip them not only wastes CPU but can potentially increase file sizes. Gzipping as many file types as possible is an easy way to reduce page weight and accelerate the user experience. Put Stylesheets at the Top tag: This is because putting stylesheets in the HEAD allows the page to render progressively.
Front-end engineers that care about performance want a page to load progressively; that is, we want the browser to display whatever content it has as soon as possible. This is especially important for pages with a lot of content and for users on slower Internet connections. The importance of giving users visual feedback, such as progress indicators, has been well researched and documented. In our case the HTML page is the progress indicator! When the browser loads the page progressively the header, the navigation bar, the logo at the top, etc.
This improves the overall user experience. The problem with putting stylesheets near the bottom of the document is that it prohibits progressive rendering in many browsers, including Internet Explorer. These browsers block rendering to avoid having to redraw elements of the page if their styles change. The user is stuck viewing a blank white page. Put Scripts at the Bottom tag: If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel.
While a script is downloading, however, the browser won't start any other downloads, even on different hostnames. In some situations it's not easy to move scripts to the bottom. If, for example, the script uses document. There might also be scoping issues. In many cases, there are ways to workaround these situations.
An alternative suggestion that often comes up is to use deferred scripts. In Internet Explorer, the script may be deferred, but not as much as desired. If a script can be deferred, it can also be moved to the bottom of the page. That will make your web pages load faster. Avoid CSS Expressions tag: They were supported in Internet Explorer starting with version 5, but were deprecated starting with IE8.
As an example, the background color could be set to alternate every hour using CSS expressions: The expression method is ignored by other browsers, so it is useful for setting properties in Internet Explorer needed to create a consistent experience across browsers. The problem with expressions is that they are evaluated more frequently than most people expect.
Not only are they evaluated when the page is rendered and resized, but also when the page is scrolled and even when the user moves the mouse over the page. Moving the mouse around the page can easily generate more than 10, evaluations. One way to reduce the number of times your CSS expression is evaluated is to use one-time expressions, where the first time the expression is evaluated it sets the style property to an explicit value, which replaces the CSS expression.
If the style property must be set dynamically throughout the life of the page, using event handlers instead of CSS expressions is an alternative approach.
Welcome to the Oath Privacy Center | Oath Policies
For front pages that are typically the first of many page views, there are techniques that leverage the reduction of HTTP requests that inlining provides, as well as the caching benefits achieved through using external files.
Reduce DNS Lookups tag: When you type www. DNS has a cost.
The browser can't download anything from this hostname until the DNS lookup is completed. DNS lookups are cached for better performance. This caching can occur on a special caching server, maintained by the user's ISP or local area network, but there is also caching that occurs on the individual user's computer. Most browsers have their own caches, separate from the operating system's cache.
As long as the browser keeps a DNS record in its own cache, it doesn't bother the operating system with a request for the record. Some of our Services provide additional controls and privacy practices. Information You Provide to Us. We may collect the information that you provide to us, such as: When you create an account with an Oath Service or brand.
When you use our Services to communicate with others or post, upload or store content such as comments, photos, voice inputs, videos, emails, messaging services and attachments. Oath analyzes and stores all communications content, including email content from incoming and outgoing mail. This allows us to deliver, personalize and develop relevant features, content, advertising and Services.
When you otherwise use our Services, such as title queries, watch history, page views, search queries, view the content we make available or install any Oath software such as plugins. When you sign up for paid Services, use Services that require your financial information or complete transactions with us or our business partners, we may collect your payment and billing information. We collect information from your devices computers, mobile phones, tablets, etc.
This information includes device specific identifiers and information such as IP addresscookie informationmobile device and advertising identifiers, browser version, operating system type and version, mobile network information, device settings, and software data.
We may recognize your devices to provide you with personalized experiences and advertising across the devices you use. We collect location information from a variety of sources.
Information from Cookies and Other Technologies. These data collection technologies allow us to understand your activity on and off our Services and to collect and store information when you interact with Services we offer to partners. We collect information about you when we receive it from other users, third-parties, and affiliatessuch as: When you connect your account to third-party services or sign in using a third-party partner like Facebook or Twitter.
From advertisers about your experiences or interactions with their offerings. When we obtain information from third-parties or other companiessuch as those that use our Services. This may include your activity on other sites and apps as well as information those third-parties provide to you or us. We may also receive information from Verizon and will honor the choices Verizon customers have made about the uses of this information when we receive and use this data.
We also may use the information we have about you for the following purposes: Provide, maintain, improve, and develop relevant features, content, and Services. Analyze your content and other information including emails, instant messages, posts photos, attachments, and other communications. You can review and control certain types of information tied to your Oath account by using Privacy Controls.
Fulfill your requests and when authorized by you. Help advertisers and publishers connect to offer relevant advertising in their apps and websites. Contact you with information about your account or with marketing messages, which you can also control. Associate your activity across our Services and your different devices as well as associate any accounts you may use across Oath Services together. We may associate activity and accounts under a single user ID.
Carry out or support promotions. Conduct research and support innovation.
These analytics and reports may include aggregate or pseudonymized information. Provide location-based Services, advertising, search results, and other content consistent with your location settings. Combine information we have about you with information we obtain from business partners or other companiessuch as your activities on other sites and apps. Detect and defend against fraudulent, abusive, or unlawful activity.