Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

v2.1.1

Latest
Compare
Choose a tag to compare
@patrixr patrixr released this 19 Oct 06:44
· 27 commits to master since this release
298c5b0

Middleware v2, complete rewrite by @stafyniaksacha ! 馃憦 馃憦

New configuration:

// config/middleware.js
module.exports = ({ env }) => ({
  settings: {
    /**
     * @typedef {Object} UserMiddlewareCacheConfig
     * @property {'mem'|'redis'=} type
     * @property {boolean=} enabled
     * @property {boolean=} logs
     * @property {boolean=} populateContext
     * @property {boolean=} populateStrapiMiddleware
     * @property {boolean=} enableEtagSupport
     * @property {boolean=} enableXCacheHeaders
     * @property {boolean=} clearRelatedCache
     * @property {boolean=} withKoaContext
     * @property {boolean=} withStrapiMiddleware
     * @property {string[]=} headers
     * @property {number=} max
     * @property {number=} maxAge
     * @property {number=} cacheTimeout
     * @property {(UserModelCacheConfig | string)[]=} models
     * @property {Object=} redisConfig
     */
    cache: {
      enabled: true,
      type: 'redis',
      models: ['review'],
      redisConfig: {
        sentinels: [
          { host: '192.168.10.41', port: 26379 },
          { host: '192.168.10.42', port: 26379 },
          { host: '192.168.10.43', port: 26379 },
        ],
        name: 'redis-primary',
      },
    },
  },
});

Full Changelog: v1.5.0...v2.1.1