Provide a Caching Entity Resolver primarily motivated by throttling and performance
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

README hosts a lot of documents that are required for validating, and often even just parsing XML documents. These DTD's, XMLSchemas, and other support files are typically very static (never change), but still need to be referenced when parsing. The huge demand for these documents has put a lot of load on the systems. So much load in fact that the systems are being crippled by it.

The blog (and comments) describe the issue, and their 'solution':

The response by has been to 'throttle' access to the system, in this case, by adding a 30 second delay to any request for these supporting documents. To mitigate the effect of these throttles, it appears that the team have been careful about setting up generous cache-control protocols for the affected documents. This cache-control information can be used to build good caches of the documents. Since the documents are essentially static, this makes sense.

The validity of the response is debatable, but, the effect is that any XML parsing of these documents is very slow if each resource has a 30-second delay.

There are a number of work-arounds to the problem, including 'catalogs' of resources, caching proxy servers, and others.

This project is yet another solution. In essence, it is a local caching system, storing these documents on disk while they are valid, and 'serving' the documents from disk until the local copy expires.

This solution largely eliminates the performance impact of these resources. It also removes the need to locate, configure and maintain web catalogs or proxy servers.

As the maintainer of the JDOM project it is apparent that JDOM usability is affected by this situation. On the other hand, the relationship between this problem and JDOM is technically quite tenuous.... it is not really within the scope of JDOM to provide Entity Resolvers... at least not yet. Certainly, a solution to the Resolver problem is useful beyond the scope of just JDOM, and the solution is completey independant of JDOM.

This Resolver project is essentially a generaly purpose Java-based Caching Resolver useful for any HTTP (HTTPS) based URL's. It contains a general-purpose front-end that can be used to plug in as an org.xml.sax.EntityResolver and javax.xml.transform.URIResolver. Additionally, this package has the ability to create a more general purpose in-memory cache that can imporv performance even more (at the expense of occupying memory....).