flash service

High_Performance_Web_Sites

Issue link: https://read.uberflip.com/i/1146286

Contents of this Issue

Navigation

Page 97 of 169

76 Chapter 11 CHAPTER 11 Rule 11: Avoid Redirects 11 A redirect is used to reroute users from one URL to another. There are different kinds of redirects—301 and 302 are the most popular. Redirects are usually done for HTML documents, but they may also be used when requesting components in the page (images, scripts, etc.). There are different reasons for implementing redirects, including web site redesign, tracking traffic flow, counting ad impressions, and creat- ing URLs that are easier for users to remember. We'll examine all of these aspects in this chapter, but the main thing to remember is that redirects make your pages slower. Types of Redirects When web servers return a redirect to the browser, the response has a status code in the 3xx range. This indicates that further action is required of the user agent in order to fulfill the request. There are several 3xx status codes: • 300 Multiple Choices (based on Content-Type) • 301 Moved Permanently • 302 Moved Temporarily (a.k.a. Found) • 303 See Other (clarification of 302) • 304 Not Modified • 305 Use Proxy • 306 (no longer used) • 307 Temporary Redirect (clarification of 302) "304 Not Modified" is not really a redirect—it's used in response to conditional GET requests to avoid downloading data that is already cached by the browser, as explained in Chapter B. Status code 306 is deprecated.

Articles in this issue

Archives of this issue

view archives of flash service - High_Performance_Web_Sites