Added cache mechanism.