WICKET-5446 Improve version matching in resource caching strategies

improves fix of WICKET-5263 [as described in JIRA comment](https://issues.apache.org/jira/browse/WICKET-5263?focusedCommentId=13846285&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13846285)