# ch20: Redirections and Load Balancing

![20.重定向与负载均衡](https://tva1.sinaimg.cn/large/007S8ZIlly1ggqr3viiwmj317q0u0aus.jpg)

## 1. Why Redirect?

* Perform HTTP transactions reliably
* Minimize delay
* Conserve network bandwidth

## 2. Overview of Redirection Protocols

General redirection methods:

* HTTP redirection
* DNS redirection
* Anycast addressing
* IP MAC forwarding
* IP address forwarding

Proxy and cache redirection techniques:

* Explicit browser configuration
* Proxy auto-configuration (PAC)
* Web Proxy Autodiscovery Protocol (WPAD)
* Internet Cache Protocol (ICP)
* Cache Array Routing Protocol (CARP)
* Hyper Text Caching Protocol (HTCP)

## 3. General Redirection Methods

### 3.1 HTTP Redirection

![](https://tva1.sinaimg.cn/large/007S8ZIlly1ggrfae8voyj311z0u0k08.jpg)

Response:

```
HTTP/1.0 302 Redirect
Server: Stronghold/2.4.2 Apache/1.3.6
Location: http://161.58.228.45/hammers.html
```

### 3.2 DNS Redirection

![](https://tva1.sinaimg.cn/large/007S8ZIlly1ggrfbih9w8j312w0ocq9u.jpg)

Just like zkname.

## 4. Proxy Redirection Methods

### 4.2 Explicit Browser Configuration

Most browsers can be configured to contact a proxy server for content.

### 4.3 Proxy Auto-configuration

An automatic configuration methodology that allows browsers to dynamically configure themselves to contact the correct proxy server solves this problem.

![](https://tva1.sinaimg.cn/large/007S8ZIlly1ggrffaxsdlj312a0u00zr.jpg)

### 4.4 Web Proxy Autodiscovery Protocol

PAC file autodiscovery.

![](https://tva1.sinaimg.cn/large/007S8ZIlly1ggrffvrz50j312q0gqwhy.jpg)
