Suds is caching each WSDL file at least twice, in file reader.py:
Class DocumentReader caches the raw sax.parse tree
Class DefinitionsReader caches the class Definitions (from file wsdl.py) data structure.
If there are imports among WSDL files, even more copies get cached.
For example, A imports B imports C -- then the cache will contain
raw sax.parse for C
Definitions for C
raw sax.parse for B
Definitions for B with C imported and resolved
raw sax.parse for A
Definitions for A with B and C imported and resolved
If I eliminate the caching of the Definitions below the top level, so that only the raw
sax.parse trees get cached, what will
break?
The reason I want to do this is to simplify the code, to make it easier to modify it to
handle WSDL files that have circular
importing relationships, such as A imports B and B imports A.
Assuming none of the WSDL files changes, the most important thing to cache is the
Definitions structure for the top-level
WSDL files. That is what the Client class needs to create a new Client instance for a
particular service.
The only time caching the Definitions structures for WSDL files below top level improves
performance is when the same
lower-level WSDL file gets imported by several top-level WSDL files.
If one of the WSDL files changes, you really need to invalidate the whole cache anyway, or
you'll risk using stale copies of
Definitions structures for WSDL files that import the changed file.