Dfx deploy gzip

Isn’t dfx suppose to use gzip per default for deployment purpose?

If yes, as of which version?
If no, there is an option to turn this on?

Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed while trying to install all canisters.
Failed to install wasm module to canister ‘backend’.
Failed during wasm installation call: The replica returned an HTTP Error: Http Error: status 413 Payload Too Large, content type “application/cbor”, content: Request 0x8a5562243e01ff6ab763f20fd3aaed4d93dc60b0ba58bfbc1a1f75dd5a852c28 is too large. Message byte size 2260078 is larger than the max allowed 2097152.

"canisters": {
    "backend": {
      "type": "rust",
      "package": "backend",
      "candid": "src/backend/backend.did",
      "optimize": "cycles"
    }
  }

❯ ls -ltr .dfx/local/canisters/backend/
total 4472
-rw-r–r-- 1 daviddalbusco staff 1561 9 oct 21:49 constructor.old.did
-rw-rw-rw- 1 daviddalbusco staff 2334 10 oct 18:03 constructor.did
-rw-rw-rw- 1 daviddalbusco staff 2327 10 oct 18:04 service.did
-rw-rw-rw- 1 daviddalbusco staff 2 10 oct 18:04 init_args.txt
-rw-r–r-- 1 daviddalbusco staff 2259670 10 oct 18:04 backend.wasm
-rw-r–r-- 1 daviddalbusco staff 3316 10 oct 18:04 service.did.js
-rw-r–r-- 1 daviddalbusco staff 2836 10 oct 18:04 service.did.d.ts
-rw-r–r-- 1 daviddalbusco staff 1959 10 oct 18:04 index.js

Ok, for some reason it is not the default. The option is called gzip.

"canisters": {
    "backend": {
      "type": "rust",
      "package": "backend",
      "candid": "src/backend/backend.did",
      "optimize": "cycles",
      "gzip": true
    }
  }
2 Likes