Add route cache and restore functionality.
Merge the code.