3.0.3 • Published 8 months ago

hapi-vary-accept v3.0.3

Weekly downloads
103
License
MIT
Repository
github
Last release
8 months ago

hapi-vary-accept

hapi pre-response handler to include Accept in the Vary header

Codecov Node CI Workflow Status

Table of Contents

Motivation

Google Chrome caches only the last response for any endpoint, regardless of content-type, which results in rendering json data instead of the rendered page based on the html representation. These values are cached even with the Cache-Control header set to no-cache in order to optimize operations like navigating back or duplicating a tab.

While normally unnecessary because of configuring the headers to prevent caching,including Accept in the Vary header does technically further inform a client that a single endpoint responds with different responses based on the Accept header of the request.

Usage

npm MIT license

Installation

:warning: This plugin does not yet support hapi v17

$ npm install hapi-vary-accept --save

Contribution

Conventional Commits Commitizen friendly semantic-release Renovate

Verification

$ npm test
3.0.3

8 months ago

3.0.2

2 years ago

3.0.1

4 years ago

3.0.0

5 years ago

2.0.0

6 years ago

1.0.0

6 years ago

1.0.0-beta.2

6 years ago

1.0.0-beta.1

6 years ago

1.0.0-beta

6 years ago