Tests for the caching middleware