Added tests for caching pages.

Fixes #2145