function sendCachedResponse(request, response, cacheObject, toggle, next, duration) {
        if (toggle && !toggle(request, response)) {
            return next();
        }

        let headers = getSafeHeaders(response);

        // Modified by @louislam, removed Cache-control, since I don't need client side cache!
        // Original Source: https://github.com/kwhitley/apicache/blob/0d5686cc21fad353c6dddee646288c2fca3e4f50/src/apicache.js#L254
        Object.assign(headers, filterBlacklistedHeaders(cacheObject.headers || {}));

        // only embed apicache headers when not in production environment
        if (process.env.NODE_ENV !== "production") {
            Object.assign(headers, {
                "apicache-store": globalOptions.redisClient ? "redis" : "memory",
                "apicache-version": "1.6.2-modified",
            });
        }

        // unstringify buffers
        let data = cacheObject.data;
        if (data && data.type === "Buffer") {
            data =
        typeof data.data === "number" ? new Buffer.alloc(data.data) : new Buffer.from(data.data);
        }

        // test Etag against If-None-Match for 304
        let cachedEtag = cacheObject.headers.etag;
        let requestEtag = request.headers["if-none-match"];

        if (requestEtag && cachedEtag === requestEtag) {
            response.writeHead(304, headers);
            return response.end();
        }

        response.writeHead(cacheObject.status || 200, headers);

        return response.end(data, cacheObject.encoding);
    }
Send a cached response to client
@param {Request} request Express request object
@param {Response} response Express response object
@param {object} cacheObject Cache object to send
@param {function(Object, Object):boolean} toggle
@param {function} next Function to call next
@param {number} duration Not used
@returns {boolean|undefined} true if the request should be
cached, false otherwise. If undefined, defaults to true.