摘要:Make sure your Ajax requests follow the performance guidelines, especially having a far future Expires header.
阅读全文
摘要:Entity tags (ETags) are a mechanism that web servers and browsers use to validatecached components.Before jumping into the details of ETags, let’s review how componentsare cached and validated. ...
阅读全文
摘要:Duplicate Scripts Hurt Performance
阅读全文
摘要:A redirect is used to reroute users from one URL to another.There are different kindsof redirects—301 and 302 are the most popular.Redirects are usually done forHTML documents, but they may also...
阅读全文
摘要:The savings from minifying CSS are typically less than the savings from minifyingJavaScript because CSS generally has fewer comments and less whitespace than Java-Script.The greatest potential for siz...
阅读全文
摘要:The Internet is based on finding servers through IP addresses.Because IP addressesare hard to remember, URLs typically contain hostnames instead, but the IP addressis still necessary for the browser t...
阅读全文
摘要:In Raw Terms, Inline Is FasterThe fewer page views per user, the stronger the argument for inlining JavaScript andCSS.If every page on your site uses the same JavaScript and CSS, using external files ...
阅读全文
摘要:The problem with expressions is that they are evaluated more frequently than mostpeople expect.Not only are they evaluated whenever the page is rendered andresized, but also when the page is scrolled ...
阅读全文
摘要:The best place to put scripts is at the bottom of the page.The page contents aren’tblocked from rendering, and the viewable components in the page are downloadedas early as possible.
阅读全文
摘要:Frontend engineers who 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 pag...
阅读全文
摘要:Rule 4, examined in this chapter, reduces response times by reducing the size of theHTTP response.If an HTTP request results in a smaller response, the transfer timedecreases because fewer packets mus...
阅读全文
摘要:Fast response time is not your only consideration when designing web pages.If itwere, then we’d all take Rule 1 to an extreme and place no images, scripts, orstylesheets in our pages.However, we...
阅读全文
摘要:A content delivery network (CDN) is a collection of web servers distributed acrossmultiple locations to deliver content to users more efficiently.This efficiency is typicallydiscussed as a performance...
阅读全文
摘要:The rules described in later chapters also present guidelines that help reduce the number ofHTTP requests, but they focus primarily on subsequent page views.Image Maps[代码]CSS Sprites[代码]Inline Images[...
阅读全文
摘要:HTTP is a client/server protocol made up of requests and responses.A browsersends an HTTP request for a specific URL, and a server hosting that URL sends backan HTTP response.Like many Internet servic...
阅读全文
摘要:In any optimization effort, it’s critical to profile current performance to identifywhere you can achieve the greatest improvements.It’s clear that the place to focus isfrontend performanc...
阅读全文