improving caching functionality so it retains needed cached items on page changes