Add middleware to handle caching. Update gems