How to disable automatic proxy caching in Internet Explorer (271361)



The information in this article applies to:

  • Microsoft Internet Explorer version 6 for Windows 2000
  • Microsoft Internet Explorer version 6 for Windows 98
  • Microsoft Internet Explorer version 6 for Windows 98 Second Edition
  • Microsoft Internet Explorer version 6 for Windows Millennium Edition
  • Microsoft Internet Explorer version 6 for Windows NT 4.0
  • Microsoft Internet Explorer version 6 for Windows XP
  • Microsoft Internet Explorer version 6 for Windows XP 64-Bit Edition
  • Microsoft Internet Explorer 5.5 for Windows 2000
  • Microsoft Internet Explorer 5.5 for Windows 95
  • Microsoft Internet Explorer 5.5 for Windows 98
  • Microsoft Internet Explorer 5.5 for Windows 98 Second Edition
  • Microsoft Internet Explorer 5.5 for Windows Millennium Edition
  • Microsoft Internet Explorer 5.5 for Windows NT 4.0

This article was previously published under Q271361
Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry

SUMMARY

When you configure Internet Explorer to use an automatic proxy configuration script, it caches the proxy that is returned by the FindProxyForURL call. The caching mechanism (Automatic Proxy Result Cache) is performed on a host basis (that is, not on an URL basis). This prevents you from using different proxies to gain access to the same Web server. The following sample scenario demonstrates this behavior:
  • Configure a Web server that is named "Webserver" with two virtual folders: "/login" and "/test".
  • Create the following .pac file:
    function FindProxyForURL (url, host)
    {
    if shExpMatch (url, "http://webserver/login") return "DIRECT";
    else return "PROXY myproxy:80";
    }
  • Configure Internet Explorer to use this .pac file.
  • Start Internet Explorer and type the following Web address:

    http://webserver/login

    Internet Explorer loads the .pac file and correctly uses a direct connection.
  • When the logon page appears, type http://webserver/test. If you use Network Monitor, you can observe that access to "http://webserver/test" still uses a direct connection instead of "myproxy".

MORE INFORMATION

The Automatic Proxy Result Cache is a performance enhancement that was added to Internet Explorer 5.5 and later. The purpose of the cache is to reduce the client-side processing of the automatic proxy configuration script. When you connect to an Internet site, the FindProxyForURL function is used to determine whether a proxy should be used and which proxy to use. Internet Explorer 5.5 and later first checks the Automatic Proxy Result Cache to determine whether a proxy was used to connect to the host on previous attempts. If this checks fails, it indicates that this is the first attempt to connect to the host during the current session and the normal proxy detection logic applies. The following list illustrates the logic Internet Explorer 5.5 and later uses to determine whether a proxy should be used and which proxy to use:
  • If Automatically Detect Settings is turned on in Internet Explorer, an attempt is made to download the Wpad.dat file from the local area network (LAN) and process it as an automatic proxy configuration script. If a proxy is returned from the script and Internet Explorer has established a connection through the proxy, the Automatic Proxy Result Cache is updated with the host and the proxy server name that was returned.
  • If Use automatic configuration script is turned on in Internet Explorer, the automatic proxy configuration script is downloaded and processed. If a proxy is returned from the script and Internet Explorer has established a connection through the proxy, the Automatic Proxy Result Cache is updated with the host and the proxy server name that was returned.
  • If Internet Explorer is configured for a static proxy server, the proxy server name is retrieved from the registry.
When Internet Explorer uses an automatic proxy configuration script, a connection is opened with the proxy server if the processing of the script indicates that a proxy is to be used. If the proxy server cannot establish a connection, the proxy server name is added to a link list of bad proxy servers so that it is not used for 30 minutes. If the automatic proxy configuration script contains a PROXY return that lists multiple proxy servers, the next proxy in the list is attempted until the list is traversed or a connection is established. If the list is traversed and no connection has been established, you receive a "Page Cannot Be Displayed" error message in Internet Explorer.

When a connection is established through a proxy server, the host name of the site and the proxy server name are cached. On future attempts to access the host name in the same session, Internet Explorer has cached information about which proxy to use. Therefore, all subsequent connections to the host are tried through the proxy that was used previously. This means that if the proxy server name that is cached is unavailable during the same session, the automatic proxy configuration script is not re-processed, and you receive a "Page Cannot Be Displayed" error message in Internet Explorer.

You may want to disable the Automatic Proxy Result Cache to provide the proxy redundancy that you require. This will result in client-side processing of every GET request that is issued by Internet Explorer. As a result, Internet Explorer performance may be impacted depending on the logic of the Automatic Proxy Configuration Script and its size. To disable the Automatic Proxy Result Cache, use one of the following methods.

Note If you disable automatic proxy caching, Internet Explorer performance may be affected.

Method 1: Modify the registry

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

You can disable the Automatic Proxy Result Cache by using the following registry key:

HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings

Value: EnableAutoproxyResultCache
Type: REG_DWORD
Data value: 0 = disable caching; 1 (or key not present) = enable automatic proxy caching (this is the default behavior)

If the registry key is not present, you can create the registry key by using the following registry file:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings]"EnableAutoProxyResultCache"=dword:00000000"

Method 2: Modify Group Policy settings

  1. Click Start, click Run, type gpedit.msc, and then click OK.
  2. In Group Policy Object Editor, double-click User Configuration\Administrative Templates\Windows Components\Internet Explorer.
  3. Double-click Disable caching of Auto-Proxy scripts.
  4. Click Disabled, and then click OK.
You may have to use this registry key if you connect by using a proxy server that is handling secure and non-secure requests on the same server. One example of this behavior is the SQUID Proxy Server software. Because Internet Explorer typically caches port information, it may not send a secure request over the correct port number when it tries to send secure and non-secure responses to the same server, but on different port numbers. For more information about the addition of the bad proxy server list, click the following article number to view the article in the Microsoft Knowledge Base:

320507 Internet Explorer does not retry bad proxy server for 30 minutes


Modification Type:MajorLast Reviewed:11/9/2005
Keywords:kbenv kbhowto KB271361