YSlow: Avoid URL redirects More Recommendations

Rule Summary

Content
Medium
Moderate
91%

Overview

Avoid using URL redirects as they add additional delays to a page load.

How does your site score on this rule?

Details from Yahoo!

URL redirects are made using HTTP status codes 301 and 302. They tell the browser to go to another location.

Inserting a redirect between the user and the final HTML document delays everything on the page since nothing on the page can be rendered and no components can be downloaded until the HTML document arrives.

recommends:

One of the most wasteful redirects happens frequently and web developers are often not aware of it.

It occurs when a trailing slash (/) is missing from a URL that should otherwise have one.

For example, going to http://astrology.yahoo.com/astrology results in a 301 response containing a redirect to http://astrology.yahoo.com/astrology/ (notice the added trailing slash).

This is fixed in Apache by using Alias or mod_rewrite, or the DirectorySlash directive if you're using Apache handlers.

Connecting an old web site to a new one is another common use for redirects. Others include connecting different parts of a website and directing the user based on certain conditions (type of browser, type of user account, etc.).

Read More

Contribute to this recommendation

Have an opinion, link, or other contribution to share regarding this recommendation? Share it with us and help make the web a faster place!