From 86f13d674adafb489f32d9d52925991e1b2d7cb0 Mon Sep 17 00:00:00 2001 From: Mukul Khanna Date: Tue, 26 Feb 2019 06:25:45 +0530 Subject: doc: add example for setting Vary: Accept-Encoding header in zlib.md PR-URL: https://github.com/nodejs/node/pull/26308 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- doc/api/zlib.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/api/zlib.md') diff --git a/doc/api/zlib.md b/doc/api/zlib.md index f4bcaf95a2..6efc2a709c 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -107,6 +107,8 @@ const http = require('http'); const fs = require('fs'); http.createServer((request, response) => { const raw = fs.createReadStream('index.html'); + // Store both a compressed and an uncompressed version of the resource. + response.setHeader('Vary: Accept-Encoding'); let acceptEncoding = request.headers['accept-encoding']; if (!acceptEncoding) { acceptEncoding = ''; -- cgit v1.2.3