Web Debug

Fix broken web applications, from servers to clients.

FindProxyForURL does not work for different urls on same web server

You may find your original auto proxy configuration script (wpad or pac file) is not working for different urls on same web server using shExpMatch in IE9+. This is because a performance enhancement named Automatic Proxy Result Cache are introduced.

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.

If you have to use different proxy configuration by urls, you can use the following methods to disable Automatic Proxy Result Cache.

Method 1: Modify the registry


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

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

Value: EnableAutoproxyResultCache Type: REGDWORD 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 Enable, and then click OK.


For more detail you can refer to http://support.microsoft.com/kb/271361

Fork me on GitHub