AutoProxy 缓存

来源:互联网 发布:淘宝澳洲第一大药房 编辑:程序博客网 时间:2024/05/08 14:46

AutoProxy 缓存

The WinHttpGetProxyForUrl function performs autoproxy lookup on a per-request basis for the specified URL. If multiple proxies are returned, client applications should test each proxy before sending the request (for more information, see theOnly One Proxy Server is Currently Supported section in AutoProxy Issues in WinHTTP). The information in this topic applies to calls toWinHttpGetProxyForUrl when the client specifies automatic proxy discovery.

WinHttpGetProxyForUrl函书对指定的URL访问时每次都要执行autoproxy发现功能。如果返回多个代理,客户程序还要在发送请求前测试每个代理(详情参见WinHTTP中的AutoProxy 问题Only One Proxy Server is Currently Supported 章节)。

WinHttpGetProxyForUrl optionally locates the autoproxy URL and downloads the autoproxy script from that site. WinHttp uses the autoproxy script to locate the proxy servers. Both the autoproxy URL and the autoproxy script are cached for the specified session. Only one autoproxy URL and script are cached for each session. Typically, the autoproxy script and URL are cached until the IP address associated with the computer changes. If a new IP address is detected during a call toWinHttpGetProxyForUrl, the call will attempt to locate a new autoproxy URL and script and cache the results. Only one user should be allowed per session, so that the cached data is not shared with other users on the computer. For more information, see WinHTTP Sessions Overview.

WinHttpGetProxyForUrl提供了定位autoproxy URL和从服务器下载autoproxy的功能选项。WinHttp使用autoproxy脚本定位代理服务器。autoproxy URL 和autoproxy脚本都会缓存在指定的会话中。在每个会话汇总只缓存一个autoproxy URL 和script。一般地,缓存的autoproxy script 和URL会在计算机IP发生变化时消失。如果调用WinHttpGetProxyForUrl时探测到新的IP地址,调用就会定位新的URL和脚本并缓存结果。一个会话只允许一个用户使用,因此缓存的数据不和计算机上其他用户共享。详情参见WinHTTP Sessions Overview。

If the out-of-process service is active when WinHttpGetProxyForUrl is called, the cached autoproxy URL and script are available to the whole computer. However, if the out-of-process service is used, and thefAutoLogonIfChallenged flag in thepAutoProxyOptions structure is true, then the autoproxy URL and script are not cached. Therefore, callingWinHttpGetProxyForUrl with thefAutoLogonIfChallenged member set toTRUE results in additional overhead operations that may affect performance. The following steps can be used to improve performance.

当调用WinHttpGetProxyForUrl时,进程外服务被激活,缓存的autoproxy URL 和script对整个计算机来说就有效了。然而,如果进程外服务被使用,并且pAutoProxyOptions参数结构体中的AutoLogonIfChallenged标识被设为TRUE,那么autoproxy URL 和script就不会被共享。因此上述情况会影响性能表现。下列步骤可以被用来改善性能。

Aa383153.wedge(en-us,VS.85).gifTo improve performance

为改善性能

  1. Call WinHttpGetProxyForUrl with the fAutoLogonIfChallenged parameter set tofalse. The autoproxy URL and script are cached for future calls toWinHttpGetProxyForUrl.
  2. 调用WinHttpGetProxyForUrl时把fAutoLogonIfChallenged参数设为false。这样autoproxy URL 和script就会被缓存起来,供后续的WinHttpGetProxyForUrl使用。
  3. If Step 1 fails, with ERROR_WINHTTP_LOGIN_FAILURE, then callWinHttpGetProxyForUrl with thefAutoLogonIfChallenged member set toTRUE.
  4. 如果上一步失败,错误代码为ERROR_WINHTTP_LOGIN_FAILURE,然后调用WinHttpGetProxyForUrl,把参数fAutoLogonIfChallenged设为TRUE。
0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 火车上行李箱砸人怎么办 违建拆除后怎么办房产证 外地车遇到限号怎么办 双号限行 违了怎么办 下高速当地限行怎么办 下高速发现限号怎么办 下高速正好限号怎么办 限号不让下高速怎么办 我的歌没有编曲怎么办 奇迹暖暖以前的账号怎么办 孕妇误吃桃胶了怎么办? 孕4个月吃了桃胶怎么办 刚怀孕吃了桃胶怎么办 额头被打了个包怎么办 裤子被84掉颜色怎么办 高中生晚上偷家里电脑上网怎么办 住高层睡不好觉怎么办 水瓶座如果恨我们了该怎么办 不锈钢保温瓶不保温了怎么办 壁纸颜色选深了怎么办 客厅壁纸太暗了怎么办 别人说你衣服丑怎么办 高楼热水器风大熄火怎么办 1楼独立下水2楼怎么办 宜家家具不会装怎么办 服务行业遇到低素质客户怎么办 服务类没有进项票怎么办 教师对学生缺乏耐心怎么办 买了竹料烂尾楼怎么办 刚毕业想换工作怎么办 客厅灯变不了光怎么办 塑料镀铝浸底漆咬底怎么办 标志408钥匙掉了怎么办 房本测绘页丢了怎么办 房本测绘页信息有误怎么办 税务登记证办完没有年检怎么办 建筑施工升降机司机证怎么办 北京建筑施工证怎么办呢 模拟城市5水抽干了怎么办 ip地址错误网络无法接通怎么办 rhino模型太大打开半天怎么办