0.1.1-alpha.64 • Published 4 years ago

smooth-plugin-headers v0.1.1-alpha.64

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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'],
        },
      },
    }
  ],
}
0.1.1-alpha.64

4 years ago

0.1.1-alpha.59

5 years ago

0.1.1-alpha.57

5 years ago