Skip to content
masterclass Buddy

Express.js · Method

res.vary

res.vary(field) adds a field to the HTTP Vary response header when it is not already present. It returns the response object.

Last updated

Syntax

res.vary(field)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • res.render()
  • Vary response header
  • Response

Source: Response · Express.js 5.x. Checked 2026-11-03.