It might be a good idea to add support for catalogs. Then you could just declare your favorite DTD's to be available locally. The coding is much less complex than a cache.