# Dfx deploy with gzip

**URL:** <https://forum.dfinity.org/t/dfx-deploy-with-gzip/16671>\
**Category:** Developers\
**Tags:** Functional-Programming\
**Created:** [November 18, 2022, 2:33pm UTC](https://forum.dfinity.org/t/dfx-deploy-with-gzip/16671 "2022-11-18T14:33:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gabriel/32/546_2.png) [@Gabriel](https://forum.dfinity.org/u/Gabriel)\
**Post date:** [November 18, 2022, 2:33pm UTC](https://forum.dfinity.org/t/dfx-deploy-with-gzip/16671/1 "2022-11-18T14:33:48Z")

</div>

Hi,

Just to piggyback on this [dfx deploy with gzip · Issue #2357 · dfinity/sdk · GitHub](https://github.com/dfinity/sdk/issues/2357)

I want to use gzip for our canisters because the massive size.

From my tests I was able to successfully gzip my test canister through dfx build and the installed wasm is around 2.5x-2.8x smaller in size.

This is how: [motoko-test/dfx.json at main · gabrielnic/motoko-test · GitHub](https://github.com/gabrielnic/motoko-test/blob/main/dfx.json) and [motoko-test/compress.sh at main · gabrielnic/motoko-test · GitHub](https://github.com/gabrielnic/motoko-test/blob/main/compress.sh)

Now my question is: is this the best way to do it?

The issue with this is I still have to “manually” create the wasm and the did files. I don’t have a problem with that but I’m wondering if there’s a better way. For reference I use motoko.

cc: @claudio

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [November 21, 2022, 8:17am UTC](https://forum.dfinity.org/t/dfx-deploy-with-gzip/16671/2 "2022-11-21T08:17:43Z")

</div>

Until we make dfx auto-gzip wasms this is probably the way to go. Here’s how some other people are doing it, which may be a bit simpler, but doesn’t work with `dfx deploy`: [BUG: Since upgrading to dfx v0.12, running into "Failed to install wasm. The replica returned an HTTP Error: Http Error: status 413 Payload Too Large" - #18 by saikatdas0790](https://forum.dfinity.org/t/bug-since-upgrading-to-dfx-v0-12-running-into-failed-to-install-wasm-the-replica-returned-an-http-error-http-error-status-413-payload-too-large/16459/18)

---

<div class="post-metadata">

**Author:** ![Gabriel](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gabriel/32/546_2.png) [@Gabriel](https://forum.dfinity.org/u/Gabriel)\
**Post date:** [November 21, 2022, 8:34am UTC](https://forum.dfinity.org/t/dfx-deploy-with-gzip/16671/3 "2022-11-21T08:34:35Z")

</div>

Ah yes, I’m aware of that, but the biggest issue is we have a lot of factories so we’ll still have to run the manual gzip for a lot of canisters and we’ll end up having a bash script.

Thank you for your input, we can use this for now until auto-gzip is enabled.
