Added cache functionality