Quy tắc này kích hoạt khi PageSpeed Insights phát hiện thấy bạn có nhiều lệnh chuyển hướng từ URL nhất định đến trang đích cuối cùng.
Tổng quan
Các lệnh chuyển hướng sẽ kích hoạt một chu kỳ phản hồi yêu cầu HTTP bổ sung và trì hoãn việc hiển thị trang. Trong trường hợp tốt nhất, mỗi lệnh chuyển hướng sẽ thêm một lượt trả về (phản hồi yêu cầu HTTP). Trường hợp xấu nhất có thể dẫn đến nhiều lượt trả lại bổ sung để thực hiện tra cứu DNS, bắt tay TCP và thương lượng TLS ngoài chu kỳ phản hồi yêu cầu HTTP bổ sung. Do đó, bạn nên giảm thiểu việc sử dụng các lệnh chuyển hướng để cải thiện hiệu suất của trang web.
Dưới đây là một số ví dụ về các mẫu chuyển hướng:
example.com sử dụng thiết kế web đáp ứng và không cần chuyển hướng – tốc độ nhanh và tối ưu!
example.com → m.example.com/home – hình phạt cho nhiều chuyến đi khứ hồi đối với người dùng thiết bị di động.
example.com → www.example.com → m.example.com – trải nghiệm trên thiết bị di động rất chậm.
[null,null,["Cập nhật lần gần đây nhất: 2024-09-04 UTC."],[[["This PageSpeed Insights rule flags pages with multiple redirects, as they negatively impact performance by adding extra HTTP request-response cycles and delaying page rendering."],["Redirects can significantly slow down a website, especially on mobile devices, by introducing additional roundtrips for DNS lookups, TCP handshakes, and TLS negotiations."],["Responsive web design is recommended to avoid redirects and provide a seamless multi-device experience."],["If redirects are necessary, follow guidelines for proper implementation and user-agent detection."],["This documentation refers to a deprecated version of the PageSpeed Insights API; the latest version (v5) offers real-world and lab data for more comprehensive insights."]]],["The content explains that multiple redirects slow down page rendering due to added HTTP request-response cycles and potential DNS lookups, TCP handshakes, and TLS negotiations. It recommends minimizing redirects and using responsive design to avoid them. When redirects are required, users should consult guidelines on redirects and user-agent detection. The document also notes that PageSpeed Insights version 4 is deprecated, and version 5 should be used instead. Lastly, it guides users to Stack Overflow and a mailing list for feedback.\n"]]