網站加速最佳實踐 – 減少DNS查詢
參考: http://developer.yahoo.com/performance/rules.html#dns_lookups
DNS 就像電話本,根據電話本查詢指定網站的 IP 地址。查詢一次 DNS 一般需要 20-120 毫秒。
The Domain Name System (DNS) maps hostnames to IP addresses, just as phonebooks map people's names to their phone numbers. When you type www.yahoo.com into your browser, a DNS resolver contacted by the browser returns that server's IP address. DNS has a cost. It typically takes 20-120 milliseconds for DNS to lookup the IP address for a given hostname. The browser can't download anything from this hostname until the DNS lookup is completed.
DNS快取可以提高效能。DNS快取可以發生在快取伺服器上,由ISP或本地區域網維持。在個人計算機的作業系統中也有DNS資訊快取。還有,大部分的瀏覽器都有自己的DNS快取。
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. The DNS information remains in the operating system's DNS cache (the "DNS Client service" on Microsoft Windows). 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.
IE瀏覽器預設保持DNS快取30分鐘,Firefox預設保持1分鐘,Fasterfox保持1小時。
Internet Explorer caches DNS lookups for 30 minutes by
default, as specified by the DnsCacheTimeout
registry setting.
Firefox caches DNS lookups for 1 minute, controlled by the network.dnsCacheExpiration
configuration setting. (Fasterfox changes this to 1 hour.)
When the client's DNS cache is empty (for both the browser and the operating system), the number of DNS lookups is equal to the number of unique hostnames in the web page. This includes the hostnames used in the page's URL, images, script files, stylesheets, Flash objects, etc. Reducing the number of unique hostnames reduces the number of DNS lookups .
減少DNS查詢可以縮短響應時間,但是減少了併發下載可能導致響應時間增加。
Reducing the number of unique hostnames has the potential to reduce the amount of parallel downloading that takes place in the page. Avoiding DNS lookups cuts response times, but reducing parallel downloads may increase response times. My guideline is to split these components across at least two but no more than four hostnames. This results in a good compromise between reducing DNS lookups and allowing a high degree of parallel downloads.
相關文章
- 網站加速最佳實踐 – 減少HTTP請求數網站HTTP
- 網站加速最佳實踐 – 避免重定向網站
- 減少對錶的查詢
- 大型網站最佳化技術:減少HTTP請求網站HTTP
- 減少HTTP請求(大型網站最佳化技術)HTTP網站
- Iceberg 資料治理及查詢加速實踐
- PostgreSQL十億級模糊查詢最佳實踐SQL
- 如何進行網站最佳化查詢,提升網站排名網站
- DNS查詢DNS
- 全民加速節:全站加速在網際網路媒體應用上的最佳實踐
- 中後臺專案 - 查詢表格業務最佳實踐
- 網站黑鏈查詢,網站黑鏈查詢,網站黑鏈查詢需要學會這幾點網站
- 論文查詢網站網站
- 全民加速節:全站加速在遊戲行業的最佳實踐遊戲行業
- DNS查詢順序DNS
- [譯] Android效能最佳實踐:減少您的APK大小看這一篇就夠了AndroidAPK
- 架構師必備:多維度查詢的最佳實踐架構
- 使用MVVM減少控制器程式碼實戰(減少56%)MVVM
- 程式碼審查最佳實踐
- 怎麼查詢登陸網站後臺?(如何查詢網站後臺地址)網站
- 愛奇藝混合雲內網DNS實踐內網DNS
- 如何查詢網站 ip 地址網站
- DNS 查詢原理詳解DNS
- 瑞星:週末攔截掛馬網站數減少新聞類網站佔主打網站
- 各大招聘網站資訊實時查詢瀏覽網站
- 關於訂單庫存扣減的最佳實踐
- 查詢論文原始碼網站原始碼網站
- 查詢天氣預報網站網站
- RDSSQLServer-最佳實踐-高CPU使用率系列之非SARG查詢SQLServer
- 千萬級資料深分頁查詢SQL效能最佳化實踐SQL
- 網站安全:dns汙染與dns劫持網站DNS
- DNS欺騙:網站克隆實現網站釣魚攻擊DNS網站
- HarmonyOS Next 網路加速進階:最佳化策略與應用實踐
- 瀏覽器的小改進讓 Facebook 網站減少 60% 的網路請求瀏覽器網站
- 2020年訪問根伺服器的DNS查詢銳減41%伺服器DNS
- DNS查詢順序以及方式DNS
- 最佳實踐:使用阿里雲CDN加速OSS訪問阿里
- ShardingSphere 異構遷移最佳實踐:將3.5億量級的顧客系統 RTO 減少60倍