PD4ML does not reinvent the wheel - it uses the standard Java's method to load resources:
URL src = new URL(resource);
URLConnection urlConnect = src.openConnection();
cm.setCookies( urlConnect );
try {
urlConnect.connect();
} catch (Throwable e) {
return new byte[0]; // requested resource is missing
}
cm.storeCookies( urlConnect );
is = urlConnect.getInputStream();
...So if any delays occur - they are most probably caused by network misconfiguration/problems, like invalid IP routing, wrong DNS responses, firewall restrictions. If network configuration is flawless, in a case of a missing resource the code should break at line #9 in a few milliseconds.
You may always optimize the above code (or for example, implement a correct HTTPS loader for your particular platform) with a custom resource loader. See:
pd4ml-html-css-pdf-tips-tricks-f7/a-definition-of-custom-resource-loaders-t40.html