Fix issue under multitenant scenario
Rework generated resource caching strategy