Fixed #5943: Fix issue about getRes for cached resources