Client side smart caching