Add caching for flat pages

This fixes #54