How to Host Online Properly

I have never hosted a ThreeJS project before. I read the documentation, but it merely says to host the files. No detail beyond this was provided.

When building and testing, I was using the following code:

    <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
    <script type="importmap">
        {
            "imports": {
                "three": "https://unpkg.com/three@0.154.0/build/three.module.js",
                "three/addons/": "https://unpkg.com/three@0.154.0/examples/jsm/"
            }
        }
    </script>
</head>
<body>
    <script type="module" src="main.js"></script>
</body>

Are es-module-shims.js version 1.6.3 and three.module.js version 0.154.0 up-to-date or are newer versions available?

Are there any security concerns that I should be aware of?

Is there anything else I should know?

Anyways, thanks in advance!

If you are using 3D models or textures - your assets become public property as soon as you put them online. There’s no way to prevent that or protect them - not much point in trying.

There are newer version of three but there were no significant updates since your 154.

If you host big 3D models or textures - (1) loading will be slower than when you tested locally, sometimes way slower; (2) the bigger the assets you load, the more bandwidth usage, the higher the bill - so optimise the assets and use some CDN with edge caching.

1 Like

cool. thx for the info <3

what exactly was updated in the newer versions?

is it possible to download these files and host them directly? would this increase performance? is it not suggested to do so?

Yes, browser also does that automatically to some extent by caching requests.

Nope, irrelevant.

1 Like