Tránh các yêu cầu gây nút thắt cổ chai
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tổng quan
Quy trình kiểm tra này xác định các yêu cầu chạy trong thời gian dài đang chặn yêu cầu quảng cáo đầu tiên. Đây là những yêu cầu đã được bắt đầu và cũng nhận được
thông tin phản hồi trước khi thực hiện yêu cầu quảng cáo đầu tiên. Việc giảm số lượng và thời lượng
của những yêu cầu chặn này sẽ làm giảm độ trễ của yêu cầu quảng cáo đầu tiên,
tăng tốc độ tải quảng cáo.
Đề xuất
Các thông tin chi tiết của quá trình kiểm tra này có 5 yêu cầu chặn hàng đầu (tính theo chi phí). Mục tiêu ở đây là xoá hoặc giảm
thời lượng của các yêu cầu này để tăng tốc độ tải quảng cáo. Sau đây là một số mẹo để thực hiện việc này:
- Loại bỏ các yêu cầu không cần thiết.
- Hoãn các yêu cầu không quan trọng cho đến khi quảng cáo được tải.
- Gửi yêu cầu song song thay vì gửi tuần tự.
- Cải thiện thời gian phản hồi bằng cách tối ưu hoá các dịch vụ phụ trợ, sử dụng HTTP/2, v.v.
Quá trình kiểm tra này hiển thị 5 yêu cầu gây nút thắt cổ chai hàng đầu theo chi phí. Chi phí của yêu cầu được tính như sau:
request duration + (request self-time * 3)
Trong đó, thời gian tự xử lý yêu cầu bằng với thời lượng trừ đi thời gian đã dùng bị các yêu cầu khác chặn. Chỉ xem xét những yêu cầu có thời gian trễ lớn hơn 250 mili giây hoặc thời lượng lớn hơn 1 giây.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eThis audit focuses on identifying and mitigating long-running requests that delay the initial ad request, ultimately hindering ad loading speed.\u003c/p\u003e\n"],["\u003cp\u003eBy reducing or removing these "blocking requests," publishers can significantly improve the latency of their first ad request.\u003c/p\u003e\n"],["\u003cp\u003eOptimization strategies include eliminating unnecessary requests, deferring non-critical requests, parallelizing request execution, and enhancing backend service response times.\u003c/p\u003e\n"],["\u003cp\u003eThe audit highlights the top 5 most impactful blocking requests based on a calculated "cost" that factors in request duration and self-time.\u003c/p\u003e\n"],["\u003cp\u003eRequests with self-times exceeding 250ms or durations longer than 1s are flagged for potential optimization to improve ad loading performance.\u003c/p\u003e\n"]]],["The audit identifies long-running requests that delay the first ad request. It highlights the top five blocking requests based on their calculated cost. Actions to reduce delays include eliminating or deferring non-critical requests, issuing requests in parallel, and improving response times. The cost of a request is its duration plus three times its self-time (duration minus blocked time). Only requests with self-time above 250ms or duration above 1s are considered.\n"],null,["# Avoid bottleneck requests\n\nOverview\n--------\n\nThis audit identifies long-running requests that are blocking the first ad\nrequest. These are requests that were initiated and which also received a\nresponse before the first ad request was made. Reducing the number and duration\nof these blocking requests will reduce the latency of the first ad request,\nspeeding up ad loading.\n\nRecommendations\n---------------\n\nThe details of this audit contain the top 5 blocking requests\n([by cost](#more_information)). The goal here is to remove or reduce the\nduration of these requests to speed up ad loading. Some tips for doing this\ninclude:\n\n- Eliminating unnecessary requests.\n- Deferring non-critical requests until after ads are loaded.\n- Issuing requests in parallel rather than serially.\n- Improving response times by optimizing backend services, using HTTP/2, etc.\n\nMore information\n----------------\n\nThis audit displays the top 5 bottleneck requests by cost. The cost of a request\nis computed as follows:\n\n`request duration + (request self-time * 3)`\n\nWhere request self-time is equal to duration minus time spent blocked by other\nrequests. Only requests with a self-time greater than 250ms or a duration\ngreater than 1s are considered. \n[View audit source](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/lighthouse-plugin-publisher-ads/audits/bottleneck-requests.js) [Improve this article](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/docs/audits/bottleneck-requests.md) [Report an issue](https://github.com/googleads/publisher-ads-lighthouse-plugin/issues/new?labels=documentation&template=documentation-feedback.md&title=Documentation+feedback%3A+bottleneck-requests.md)\n\n\u003cbr /\u003e"]]