Torsten Knodt wrote: > Yes, I know. But it'S still to much coding for it in the > CIncludeTransformer. > Components which need the content of a source, should simply get > it, and not > think about caching. It's not their job. Caching is needed in to > many places. > All places which use sources, should have caching. No, not *all* places. Caching is an option not a *must*. There are sources that can be delivered faster without caching and there are sources where you simply don't know if they update (when your cache becomes invalid).
> It should only > be done at > one place for each kind of data. > So what I suggest is introducing SourceUtil.getInputStream for > InputStream's > of sources. Then modify toDOM and toSAX to cache their output, to > not have > them to parse them first out of the cached InputStream's. So we > would cache > InputStream's, DOM's and SAX streams. The only changes in the components > would be to use SourceUtil, where they currently use their own code. I think a save way would be too add those methods to the SourceUtil, but give them a different name (ala cachedToDOM etc), so an implementation can decide if it wants to use caching or not. Carsten