Added res.vary()

Fixes #1682