nit: the way the if are written this means `settings.CACHE_MIDDLEWARE_SECONDS = 0` won't work correctly. We don't really care though. A possible solution would be
```
    def process_response(self, request, response):
        timeout = get_max_age(response)
        if timeout is None:
            timeout = settings.CACHE_MIDDLEWARE_SECONDS

        if timeout != 0:
            # Only add caching headers if max-age was not set to 0
            patch_response_headers(response, timeout)
        return response
```