How can we pre-load validation resources at FHIR server startup time rather than dynamically at runtime?
We are noticing that this loading into memory takes a long time (19 seconds) when it is performed by DefaultProfileValidationSupportNpmStrategy. The issue with this is that the loading occurs the first time our code raises a ResourceNotFoundException on the Read endpoint for ResearchStudy. This eventually generates the expected 404 response, but is not an acceptable page response time for users.
2023-08-21 09:57:05.095 INFO 19974 --- [nio-8080-exec-9] faultProfileValidationSupportNpmStrategy : Loading R5 Core+Extension packages into memory
2023-08-21 09:57:24.388 INFO 19974 --- [nio-8080-exec-9] faultProfileValidationSupportNpmStrategy : Loaded 34377 Core+Extension resources in 00:00:19.293
We see that this emanates from hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/DefaultProfileValidationSupportNpmStrategy.java.
So, how can we pre-load the resources at server startup?