Two-layer network caching for different service requirements