Fix incompatibility with caching middleware.