Is it possible to disable the caching of welcome files in the
ServletPathMatcher class? I'm playing with some dynamic behaviors where I have a custom resource manager which serves content from different folders based on data in the servlet.
To clarify, there is
- A single server deployment
- A single servlet deployment
- A single (bespoke) resource manager
- More than one folder to serve content from which is dynamically determined in my custom resource manager
Overall, everything is working well (And I'm doing this sort of oddball thing to mimic how Adobe ColdFuson's version of Tomcat allows more than one host/web root in a single deployment, controlled by the front end server's virtual hosts). The problem is, whichever site I hit first caches the lookups for the welcome files and never performs the lookup again. So if one content root has an index.cfm and the other doesn't, undertow tries to load it anyway, or vice versa.
I can see the allure of caching these lookups, but it simply doesn't work here. I would prefer to implement my own cached resource manager (which takes into account the dynamic content roots) and have the servlet path match classes not try to cache anything on its own. Even if this was a non-standard setting I could enable/disable.
Is this possible? My initial review of the Undertow source doesn't reveal a way to disable these caches. And the SerlvetPathMatches.invalidate() method, in addition to being seemingly heavy-handed, is not thread safe from my testing. I also see logic for a ResourceChangeListener, but this also wouldn't help here since the actual file system isn't being modified.
Thanks!
~Brad
Developer Advocate
Ortus Solutions, Corp