smooth-plugin-headers

0.1.1-alpha.64 • Public • Published

smooth-plugin-headers

Automatically adds response headers.

Usage

Edit smooth.config.js:

// smooth.config.js
module.exports = {
  plugins: [
    {
      resolve: 'smooth-plugin-headers',
      options: {
        // Add any options here
      },
    }
  ],
}

Options

headers

Set headers for all maching pages, ReactRouter format can be used (see path-to-regexp).
Headers entries are merged on differents rules but are overwritten on sames, below rules overwrite above ones.

// smooth.config.js
module.exports = {
  plugins: [
    {
      resolve: 'smooth-plugin-headers',
      options: {
        headers: {
          '(.*)': ['Cache-Control: public, max-age=900'],
          '(*.ico)': ['Cache-Control: public, max-age=2592000'],
          '/graphql': ['Cache-Control: no-cache'],
        },
      },
    }
  ],
}

Readme

Keywords

Package Sidebar

Install

npm i smooth-plugin-headers

Weekly Downloads

2

Version

0.1.1-alpha.64

License

MIT

Unpacked Size

7.6 kB

Total Files

9

Last publish

Collaborators

  • neoziro