Help and Support

How to disable automatic proxy caching in Internet Explorer

Article ID:271361
Last Review:October 27, 2007
Revision:6.3
This article was previously published under Q271361
On This Page

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".

Back to the top

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.

Back to the top

Method 1: Modify the registry

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 (http://support.microsoft.com/kb/322756/) How to back up and restore the registry in Windows


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"

Back to the top

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 (http://support.microsoft.com/kb/320507/) Internet Explorer does not retry bad proxy server for 30 minutes

Back to the top


APPLIES TO
Microsoft Internet Explorer 5.5
Microsoft Internet Explorer 6.0, when used with:
  Microsoft Windows XP Home Edition
  Microsoft Windows XP Professional
  Microsoft Windows XP Media Center Edition
  Microsoft Windows XP Tablet PC Edition
  Microsoft Windows XP Professional x64 Edition
  Microsoft Windows 2000 Advanced Server
  Microsoft Windows 2000 Datacenter Server
  Microsoft Windows 2000 Professional Edition
  Microsoft Windows 2000 Server
  Microsoft Windows NT Server 4.0 Standard Edition
  Microsoft Windows NT Server 4.0, Terminal Server Edition
  Microsoft Windows NT Workstation 4.0 Developer Edition
  Microsoft Windows Millennium Edition
  Microsoft Windows 98 Second Edition
  Microsoft Windows 98 Standard Edition
Windows Internet Explorer 7

Back to the top

Keywords: 
kbenv kbhowto KB271361

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.