Implement Window context cache mechanics and its corresponding test case.