# How long does it take code to go live?

**URL:** <https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474>\
**Category:** Developers\
**Created:** [June 24, 2021, 6:12am UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474 "2021-06-24T06:12:12Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 6:12am UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/1 "2021-06-24T06:12:13Z")

</div>

When I run `dfx deploy --network ic`  
Sometimes the new frontend code is seen immediately. Other times I do not see the new code loading for a long time. I have tried hard refresh, etc.

Any ideas or docs on duration until live?

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 2:32pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/2 "2021-06-24T14:32:36Z")

</div>

It’s going to vary depending on what you’re uploading, but as soon as the output from dfx deploy finishes and your terminal is ready to accept input again, your canister should be live

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 4:09pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/3 "2021-06-24T16:09:59Z")

</div>

@anon74414410 That is what I expected, but… it is no longer working. Up until when I posted this, it was working fine.

index.5dcfc311.js should be the lates js file served according to the terminal. I see [index.110754bd.js. This is the file from 4 -5 pushes ago.

[https://sygsn-caaaa-aaaaf-qaahq-cai.raw.ic0.app/](https://sygsn-caaaa-aaaaf-qaahq-cai.raw.ic0.app/)

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 4:12pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/4 "2021-06-24T16:12:17Z")

</div>

Hmm, it seems like you’re hashing your filenames, so we may not be overwriting them in an attempt to optimize. Try `dfx deploy --network ic --mode reinstall`

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 4:25pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/5 "2021-06-24T16:25:19Z")

</div>

> [@anon74414410](#):
>
> dfx deploy --network ic --mode reinstall

I am on dfx 0.7.0, using a Mac

> dfx deploy --network ic --mode reinstall  
> Preformatted text` **error:** Found argument '--mode' which wasn't expected, or isn't valid in this context If you tried to supply `–mode`as a PATTERN use`– --mode`

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 4:27pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/6 "2021-06-24T16:27:20Z")

</div>

Oh whoops, forgot that we don’t have that argument on deploy. You’ll need to do `dfx build` and `dfx canister --network ic install <canister-name> --mode reinstall`

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 4:27pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/7 "2021-06-24T16:27:56Z")

</div>

You may also want to update to `dfx 0.7.2`

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 4:40pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/8 "2021-06-24T16:40:00Z")

</div>

@anon74414410 I really thought this would work. But noooo!

Upgraded to DFX 0.7.2, and then built and pushed with the commands above. It took longer to redeploy. Which suggests it was adding in new files/ But on hard refresh I still see index.110754bd.js, the old file.

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 4:44pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/9 "2021-06-24T16:44:19Z")

</div>

Yeah, things kinda seem like they’re working. It might be that the old `index.html` is still hanging around. Can you compare the index.html you have with the one that’s live, and maybe try deleting your build output directory and re-running your build job on your machine?

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 4:57pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/10 "2021-06-24T16:57:38Z")

</div>

This was working yesterday and then it stopped after the 2- 3rd push of the day.

I tried deleting and rebuilding on local. Then pushing again as you suggested.  
I still see the old index.html code which does not match the one I have just built and deployed. To test I changed the index.html to have ICME V0.2 as the title.

Other note: when I run ‘dfx build’ it automatically deletes all of the contents of dist folder, and adds new files.

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 5:03pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/11 "2021-06-24T17:03:43Z")

</div>

Without pairing on this with you, I’m not sure what else to try. Maybe double-check the `dfx.json` and `canister_ids.json` to make sure that you’re pointing to the same canister? Mode reinstall ought to replace the asset canister’s wasm with the latest one and then re-upload all the files

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 5:25pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/12 "2021-06-24T17:25:58Z")

</div>

This is a tough one. No general project changes were made since it was working and now. It just simply stopped deploying new code, no errors being shown. Very basic JS changes, and not dfx changes. etc.

When you view the source of the site on your end, what asset.js file do you see? It might be cacheing or some other network feature.

My local subnet might hate me.

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 5:30pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/13 "2021-06-24T17:30:00Z")

</div>

I’m still getting the v.01 site, so this could be a caching issue. I’ll check in with the boundary nodes team

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 5:56pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/14 "2021-06-24T17:56:27Z")

</div>

I’m seeing v.0.2 now. I don’t know if you tried something different, or if something was just hung up

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 6:02pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/15 "2021-06-24T18:02:53Z")

</div>

Hi @anon74414410 . Thanks for your help. I used Git to resolve the problem. Reverted back to the previous day, changed v0.1 to v0.2 and pushed. It worked. Moved back to present, checked differences, and found it!

In my root I have canister\_ids.json. Not sure how it happened, but those ids were changed. Moved back to the old canister\_ids.json and deploys work again.

How do I delete those newly created canisters from IC or turn them off?

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [June 24, 2021, 6:06pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/16 "2021-06-24T18:06:05Z")

</div>

If you want to reclaim the cycles, I recommend installing a cycles wallet to them and sending their balance back to your main wallet.

Otherwise, `dfx canister stop` and `dfx canister delete` will shut them down

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [June 24, 2021, 6:13pm UTC](https://forum.dfinity.org/t/how-long-does-it-take-code-to-go-live/5474/17 "2021-06-24T18:13:25Z")

</div>

Thank you! I guess now I have a staging and production environment.
