File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export function connectProxyResolver(
2929 return configureModuleLoading ( extensionService , lookup ) ;
3030}
3131
32- const maxCacheEntries = 10000 ;
32+ const maxCacheEntries = 5000 ; // Cache can grow twice that much due to 'oldCache'.
3333
3434function createProxyAgent (
3535 extHostWorkspace : ExtHostWorkspace ,
@@ -50,9 +50,11 @@ function createProxyAgent(
5050 let oldCache = new Map < string , string > ( ) ;
5151 let cache = new Map < string , string > ( ) ;
5252 function getCacheKey ( url : string ) {
53- // Expecting proxies to usually be the same per host. Keeping the path in for now.
54- const queryIndex = url . indexOf ( '?' ) ;
55- return queryIndex === - 1 ? url : url . substr ( 0 , queryIndex ) ;
53+ // Expecting proxies to usually be the same per scheme://host:port. Assuming that for performance.
54+ const parsed = nodeurl . parse ( url ) ; // Coming from Node's URL, sticking with that.
55+ delete parsed . pathname ;
56+ delete parsed . search ;
57+ return nodeurl . format ( parsed ) ;
5658 }
5759 function getCachedProxy ( key : string ) {
5860 let proxy = cache . get ( key ) ;
You can’t perform that action at this time.
0 commit comments