Yeah, you're right. Because my request is not respond 404. It's going slowly and sometimes 504 time out. So what do you suggests me?
Start with the DNS. If it is slow and only breaks sometimes, DNS is the most likely thing and might be just slow enough that sometimes it works barely and sometimes it fails. 504 is server side error unable to respond.
If JS files are trying to be pulled from remote, then DNS has to be used. If DNS is pointing externally, we'd expect the delay. If it works sometimes, that means that there is some sort of fallback that is likely just timing out sometimes.