Disable gzip in middleware

System Information
  • Strapi Version: 3.5.1

Strapi Middlewares documentation say about Response middlewares :
https://strapi.io/documentation/developer-docs/latest/concepts/middlewares.html#core-middleware-configurations that is possible to enable or not GZIP response compression.

What I’m need to write to config/middleware.js to disable gzip ?

Is I’m write below a correct settings? (config/middleware.js):

module.exports = {
  load: {
    // before: ['responseTime', 'logger', 'cors', 'responses'],
    // before: [ 'responses'],
    before: ['timer', 'responseTime', 'logger', 'cors', 'responses', 'gzip'],
    // order: [
    //   "Define the middlewares' load order by putting their name in this array in the right order",
    // ],
    after: ['parser', 'router','session'],
  settings: {
    // cors: {
    //   origin: ['http://localhost', 'https://mysite.com', 'https://www.mysite.com'],
    // },
    timer: {
      enabled: true,
    gzip : {enabled: false}

Hey @Gayrat :wave:,

It looks like gzip is disabled by default.
Your config example is correct, but not needed :wink:

1 Like