Project

Profile

Help

Bug #5635

closed

I cannot disable the catalog resolver disk cache and avoid it creating the cache folder and files

Added by Radu Coravu over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Low
Category:
Resolvers
Sprint/Milestone:
-
Start date:
2022-08-05
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Any time a new transformer is created, I get a bunch of files created here: C:/Users/radu_coravu/.xmlresolver.org/cache/ I've already set up the code to disable the cache:

    ResourceResolver rsrcResolver = config.getResourceResolver();
    if (rsrcResolver instanceof CatalogResourceResolver) {
      ((CatalogResourceResolver) rsrcResolver).setFeature(ResolverFeature.CACHE_ENABLED, Boolean.FALSE);
    }

but it's too late, that folder is still getting created and content from it is being read when the Configuration is being created:

	at org.xmlresolver.cache.ResourceCache.reset(ResourceCache.java:211)
	at org.xmlresolver.cache.ResourceCache.<init>(ResourceCache.java:145)
	at org.xmlresolver.XMLResolverConfiguration.getFeature(XMLResolverConfiguration.java:1098)
	at org.xmlresolver.CatalogResolver.<init>(CatalogResolver.java:51)
	at org.xmlresolver.Resolver.<init>(Resolver.java:68)
	at net.sf.saxon.lib.CatalogResourceResolver.<init>(CatalogResourceResolver.java:46)
	at net.sf.saxon.Configuration.init(Configuration.java:622)
	at net.sf.saxon.Configuration.<init>(Configuration.java:433)
	at net.sf.saxon.s9api.Processor.<init>(Processor.java:74)

In general I do not see why an XML catalog resolver should have a folder cache on disk, Saxon doesn't have a cache and it's pretty fast. Are there performance tests which demonstrate that a disk cache of the resolver is useful? Also for now we are not really using the xmlresolver for anything, so having some way of disabling its cache before it writes and reads content from that cache folder would be nice.

Please register to edit this issue

Also available in: Atom PDF