Explicit Proxy Caching

If you want to use Traffic Server as an explicit proxy cache, you must configure client software (i.e., browsers) to send requests directly to Traffic Server.

Explicit Proxy Caching for HTTP

If you do not configure Traffic Server to use the transparency option (with which client requests are intercepted en route to origin servers by a switch/router and rerouted to the Traffic Server machine), then clients must configure their web browsers to send HTTP requests to the Traffic Server proxy cache by configuring their browsers to download proxy configuration instructions from a PAC file (Proxy Auto-Configuration file).

Configuring Browsers Manually

To manually configure a browser to send HTTP requests to Traffic Server, clients must provide the following information:

In addition, clients can specify not to use Traffic Server for certain sites - in such cases, requests to the listed sites go directly to the origin server. The procedures for manual configuration vary among browser versions; refer to specific browser documentation for complete proxy configuration instructions. You do not need to set any special configuration options on Traffic Server if you want to accept requests from manually-configured browsers.

Using a PAC File

A PAC file is a specialized JavaScript function definition that a browser calls to determine how requests are handled. Clients must specify (in their browser settings) the URL from which the PAC file is loaded. You can store a PAC file on Traffic Server (or on any server in your network) and then provide the URL for this file to your clients.

If you want to store a PAC file on the Traffic Server system, then you must perform the following configuration:

Configure Traffic Server to provide a PAC file manually:
  1. If you have an existing PAC file, then replace the proxy.pac file located in the Traffic Server config directory with the existing file.
  2. In a text editor, open the records.config file located in the Traffic Server config directory.
  3. Edit the following variable:
  4. Variable Description
    proxy.config.admin.autoconf_port

    Set this variable to specify the port Traffic Server uses to serve the PAC file. The default port is 8083.

  5. Save and close the records.config file.
  6. In a text editor, open the proxy.pac file located in the Traffic Server config directory.
  7. Save and close the proxy.pac file.
  8. Restart Traffic Server.
  9. Inform your users to set their browsers to point to this PAC file; click here for browser settings.

Sample PAC File

The following sample PAC file instructs browsers to connect directly to all hosts without a fully-qualified domain name and to all hosts in the local domain. All other requests go to the Traffic Server named myproxy.company.com.

function FindProxyForURL(url, host) 
{
if (isPlainHostName(host)) ||
(localHostOrDomainIs(host, ".company.com")) {
return "DIRECT";
}
else
return "PROXY myproxy.company.com:8080;" +
"DIRECT";
}