IPFS not loading documents sometimes

Yesterday I hosted a multi page website on IPFS with reference to this tutorial link.

When using the basic ipfs.io-gateway, the page loaded at first. When I tried it again after sometime It was loading indefinitely (i.e. the page didn’t load). Then after an hour the page loaded again even though I didn’t make any changes.

(Note: I tried loading the page 2 or 3 times, sometimes it would just load indefinitely and sometimes the gateway would time out after a bit( 504 Gateway Timeout))

Afterwards I published the multi-page website to IPNS (gateway.ipfs.io/ipns/). I had a similar issue here too. It loaded indefinitely (wasn’t loading the page) and then after sometime (like an hour) when I checked, the page was loading just fine.

Why does the page load sometimes and not other times? What can be done about this?
If this is the expected behaviour, won’t it be an issue to host websites and share it to users?

Try using ipfs-check.on.fleek.co as a basic check to verify that your data is being advertised by your IPFS node and that your node is reachable over the public internet. If the results from that check aren’t helpful post them back and it’ll be easier to answer followup questions.

I tested the peerID and I got this error.

It says if you get ‘Could not connect to the multiaddr’ : Machines on the internet cannot talk to your machine. Fix your firewall, add port forwarding, or use a relay.

Can you expand on this? or give some more insight?

Your node isn’t advertising any public IP addresses, so it’s not reachable from the internet at large. Either set up some port mappings on your router, or enable RelayClient. Once you’ve done one of those things, test again and it should work

Port forwarding