Ta reguła się uruchamia, gdy PageSpeed Insights wykryje więcej niż jedno przekierowanie z danego adresu URL na ostateczną stronę docelową.
Opis
Przekierowania aktywują dodatkowy cykl żądania-odpowiedzi HTTP i opóźniają renderowanie strony. W najlepszym przypadku każde przekierowanie wiąże się z pojedynczym transferem danych w obie strony (odpowiedzi na żądanie HTTP), a w najgorszym razie – w najgorszym razie może skutkować wieloma dodatkowymi cyklami wyszukiwania DNS, uzgadniania połączenia TCP i negocjacji TLS oprócz dodatkowego cyklu żądania i odpowiedzi HTTP. Dlatego zalecamy, aby jak najmniej korzystać z przekierowań, aby poprawić wydajność witryny.
Oto kilka przykładów wzorców przekierowań:
Witryna example.com jest zaprojektowana w sposób elastyczny i nie wymaga przekierowań – szybko i optymalnie.
example.com → m.example.com/home – kara za lot w obie strony w przypadku użytkowników urządzeń mobilnych.
example.com → www.example.com → m.example.com – bardzo wolne działanie na urządzeniach mobilnych.
[null,null,["Ostatnia aktualizacja: 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"]]