# Improving load times ipfs hosted static site

**URL:** <https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889>\
**Category:** Help\
**Tags:** go-ipfs, ipns\
**Created:** [August 4, 2017, 3:33pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889 "2017-08-04T15:33:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pors](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pors/32/2566_2.png) [@pors](https://discuss.ipfs.tech/u/pors)\
**Post date:** [August 4, 2017, 3:33pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/1 "2017-08-04T15:33:31Z")

</div>

Hi, I am writing a blog about decentralization and it can currently be accessed old skool via an nginx server, or through the ipfs gateway I run on that server.

- The normal http central site loads fast: [http://decentralized.blog/](http://decentralized.blog/)
- The decentralized version loads sometimes fast, sometimes very slow: [http://decentralized.blog:8080/ipfs/QmUAz4unWjfWa7xkHttod8gG3gfyob3HrWFByUvrKH6Toa/](http://decentralized.blog:8080/ipfs/QmUAz4unWjfWa7xkHttod8gG3gfyob3HrWFByUvrKH6Toa/)
- The same decentralized version via ipns is always slow: [http://decentralized.blog:8080/ipns/QmRf4ERGvYpVo6HRa2VueZT8pWi8YvyLS3rW6ad2y83tdN/](http://decentralized.blog:8080/ipns/QmRf4ERGvYpVo6HRa2VueZT8pWi8YvyLS3rW6ad2y83tdN/)

What is the approach to figure out what is actually causing these load and/or resolve times?

What is the thing to do to improve load and/or resolve times?

Any hints are much appreciated!

Cheers,  
Mark

---

<div class="post-metadata">

**Author:** ![es\_00788224](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@es\_00788224](https://discuss.ipfs.tech/u/es_00788224)\
**Post date:** [August 4, 2017, 11:55pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/2 "2017-08-04T23:55:43Z")

</div>

> [@pors](#):
>
> What is the approach to figure out what is actually causing these load and/or resolve times?

Are you pinning the site on the gateway?

> [@pors](#):
>
> What is the thing to do to improve load and/or resolve times?

IPNS optimization work is currently in progress. You could always give out the IPFS hash and add a “load latest” button somewhere that goes to the IPNS hash (which points to a HTML redirect page which in turn redirects to the IPFS hash).  
You could use JavaScript to make this transparent to the end user.

---

<div class="post-metadata">

**Author:** ![pors](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pors/32/2566_2.png) [@pors](https://discuss.ipfs.tech/u/pors)\
**Post date:** [August 5, 2017, 6:28am UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/3 "2017-08-05T06:28:56Z")

</div>

Ah, no I didn’t pin. I thought that was explicit for the node that adds data.

And thanks for the redirect tip, will do.

Thanks a lot @es_00788224!

---

<div class="post-metadata">

**Author:** ![pors](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pors/32/2566_2.png) [@pors](https://discuss.ipfs.tech/u/pors)\
**Post date:** [August 5, 2017, 3:57pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/4 "2017-08-05T15:57:18Z")

</div>

It seems that objects that were added to a node are indeed pinned by default, see [https://ipfs.io/ipfs/QmNZiPk974vDsPmQii3YbrMKfi12KTSNM7XMiYyiea4VYZ/example#/ipfs/QmP8WUPq2braGQ8iZjJ6w9di6mzgoTWyRLayrMRjjDoyGr/pinning/readme.md](https://ipfs.io/ipfs/QmNZiPk974vDsPmQii3YbrMKfi12KTSNM7XMiYyiea4VYZ/example#/ipfs/QmP8WUPq2braGQ8iZjJ6w9di6mzgoTWyRLayrMRjjDoyGr/pinning/readme.md)

The relevant piece of content:

```
$ ipfs pin ls --type=all
.
.
.
QmUAz4unWjfWa7xkHttod8gG3gfyob3HrWFByUvrKH6Toa recursive

```

So: content was pinned, but loading the content is super slow (sometimes).

Are there other steps to follow to find the root cause?

Thanks!  
Mark

---

<div class="post-metadata">

**Author:** ![pors](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pors/32/2566_2.png) [@pors](https://discuss.ipfs.tech/u/pors)\
**Post date:** [August 7, 2017, 2:24pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/5 "2017-08-07T14:24:08Z")

</div>

I started digging a bit deeper, some observations:

- Restarting the daemon makes the request [http://decentralized.blog:8080/ipfs/QmUAz4unWjfWa7xkHttod8gG3gfyob3HrWFByUvrKH6Toa/](http://decentralized.blog:8080/ipfs/QmUAz4unWjfWa7xkHttod8gG3gfyob3HrWFByUvrKH6Toa/) fast again
- IPNS requests are slow whatever I do (doesn’t matter from what gateway the request comes from)
- My IPFS node eats up all memory on my VPS after a few hours
- When that happens the site still loads fast from the official gateway: [https://gateway.ipfs.io/ipfs/QmUAz4unWjfWa7xkHttod8gG3gfyob3HrWFByUvrKH6Toa/](https://gateway.ipfs.io/ipfs/QmUAz4unWjfWa7xkHttod8gG3gfyob3HrWFByUvrKH6Toa/)
- From my own server it’s also still fast. Hmm.

So that doesn’t really lead up to some conclusion 🙂

Does anyone have an idea how to analyze what the cause is? I have some other ideas, but it needs to get slow again 🙂

---

<div class="post-metadata">

**Author:** ![flyingzumwalt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/flyingzumwalt/32/12_2.png) [@flyingzumwalt](https://discuss.ipfs.tech/u/flyingzumwalt)\
**Post date:** [August 7, 2017, 3:03pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/6 "2017-08-07T15:03:13Z")

</div>

@pors thanks for testing this stuff. The core maintainers of go-ipfs are _really_ busy right now but will be coming up for air very soon and the info you’re gathering will be useful. We want to do lots of optimizations over the coming months. The issues you’re surfacing will help us target those efforts. First on the list is to make IPNS a lot faster – a couple people are already working on that one. 😉

If you figure out ways to reliably reproduce the slow response times, I’d say go ahead and submit a bug report on [https://github.com/ipfs/go-ipfs](https://github.com/ipfs/go-ipfs) with instructions on how to recreate the issues. That will make it easier for the committers to keep track of it, and to let you know when it’s been addressed.

---

<div class="post-metadata">

**Author:** ![pors](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pors/32/2566_2.png) [@pors](https://discuss.ipfs.tech/u/pors)\
**Post date:** [August 7, 2017, 3:30pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/7 "2017-08-07T15:30:43Z")

</div>

@flyingzumwalt I have a suspicion why they are busy 🙂

I’ll add to this post when I find out more!

---

<div class="post-metadata">

**Author:** ![Accordingly](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/accordingly/32/2573_2.png) [@Accordingly](https://discuss.ipfs.tech/u/Accordingly)\
**Post date:** [August 21, 2017, 11:58pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/8 "2017-08-21T23:58:02Z")

</div>

Just want to chime in and say we too are experiencing greatly varied load times when hosting on our own gateway (thought that would do the trick!) so any attention devs can pay attention to this issue are greatly appreciated. We really want to stay hosted on IPFS!!

---

<div class="post-metadata">

**Author:** ![Kadukeco](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@Kadukeco](https://discuss.ipfs.tech/u/Kadukeco)\
**Post date:** [August 23, 2017, 3:05pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/9 "2017-08-23T15:05:10Z")

</div>

Did that suspicion work out? Any new ideas about why load times vary so much?

---

<div class="post-metadata">

**Author:** ![pors](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pors/32/2566_2.png) [@pors](https://discuss.ipfs.tech/u/pors)\
**Post date:** [August 23, 2017, 3:19pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/10 "2017-08-23T15:19:04Z")

</div>

> [@Kadukeco](#):
>
> Did that suspicion work out? Any new ideas about why load times vary so much?

My suspicion referred to why they were busy (the filecoin ICO) 🙂

Load times vary because of a couple of reasons as far as I understand it:

- how many nodes have your data (it’s like bittorrent)
- how fast/busy is the gateway you use
- if you use IPNS to resolve: this is slow unless cached it seems
- … more?

---

<div class="post-metadata">

**Author:** ![jmozac](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jmozac](https://discuss.ipfs.tech/u/jmozac)\
**Post date:** [April 5, 2018, 7:37pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/11 "2018-04-05T19:37:33Z")

</div>

i have the same problem with you. you posted it on Aug 2017, and i still face this problem in April 2018. Do you solved the problem?

---

<div class="post-metadata">

**Author:** ![leerspace](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@leerspace](https://discuss.ipfs.tech/u/leerspace)\
**Post date:** [April 5, 2018, 11:44pm UTC](https://discuss.ipfs.tech/t/improving-load-times-ipfs-hosted-static-site/889/12 "2018-04-05T23:44:59Z")

</div>

I’m copy/pasting my comment from another discussion related to IPNS resolve times.

As of v0.4.14, IPNS resolution is a lot faster now when using the new pubsub IPNS resolver and publisher: [https://ipfs.io/blog/34-go-ipfs-0.4.14#ipns-improvements](https://ipfs.io/blog/34-go-ipfs-0.4.14#ipns-improvements).
