Make CachedResourceLoader originsMatch check more efficient