Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the library caches WSDLs for the lifetime of the process. This is not ideal for long running processes like a backend service that connect to many SOAP webservices.
Adding an option to override the current lifetime cache with a custom cache so user can bring their own cache, e.g. TTL or LRU. I had considered just disabling the cache using the existing option, but this is not also not ideal.
Code changes:
IWSDLCache
interface which can be extended with custom caching implementationsDefaultWSDLCache
implementation which matches current caching handling, ie global singleton which indefinitely caches WSDLs.options.wsdlCache
to allow users to override the default cache.I also tested with npm link against an existing application that uses node-soap. By adding ?v=1, ?v=2 and so on to the WSDL URL, you can simulate loading many different WSDLs. Setting
max-old-space-size
to something like 128, eventually the process will crash with the default cache. For my application, this occurred around 1000th WSDL with a 128mb limit. I updated to use a cache with a set max item limit and memory remained low and the process did not crash even when reaching the 1000 WSDL loaded mark.