How to make the HTML5 loader more resilient on slower connections?


A sample from @dev-masih he said he tested in incognito mode right after, which means it’s probably not only a problem with our CDN.

What do I need to change in the project to make the loader try more times / try longer when it is having trouble loading the project file segments?

1 Like


And an error message for when something goes wrong with loading process is necessary.

1 Like


A sample from @Dragosha

This is the link for testing



From `dmloader.js?:

    * 'extra_params' is an optional object that can have the following fields:
    *     'archive_location_filter':
    *         Filter function that will run for each archive path.
    *     'unsupported_webgl_callback':
    *         Function that is called if WebGL is not supported.
    *     'engine_arguments':
    *         List of arguments (strings) that will be passed to the engine.
    *     'persistent_storage':
    *         Boolean toggling the usage of persistent storage.
    *     'custom_heap_size':
    *         Number of bytes specifying the memory heap size.
    *     'disable_context_menu':
    *         Disables the right-click context menu on the canvas element if true.
    *     'retry_time':
    *         Pause before retry file loading after error.
    *     'retry_count':
    *         How many attempts we do when trying to download a file.
    *     'can_not_download_file_callback':
    *         Function that is called if you can't download file after 'retry_count' attempts.

and, in your engine_template.html, modify this section to add your extra params:

	var extra_params = {
		archive_location_filter: function( path ) {
		engine_arguments: [{{#DEFOLD_ENGINE_ARGUMENTS}}"{{.}}",{{/DEFOLD_ENGINE_ARGUMENTS}}],
		custom_heap_size: {{DEFOLD_HEAP_SIZE}},
		disable_context_menu: true
1 Like


Please, pay attention to this section of HTML5 manual:
retry_time and retry_count parameters



Do you have a suggestion for these setting values? What are the defaults? What is the retry time in? Seconds?

Looks like these are the default values?

            retry_time: 1, 
            retry_count: 10,

Also retry_time is multiplied by 1000 so probably seconds?

I’m going to try

		retry_time: 3,
		retry_count: 20
1 Like


Please repor with results! We’re happy to update the defaults if it helps. Also if anyone want to take a stab at the loader code itself we can integrate the changes as well.



Previous numbers did not seem high enough, next build I will test

		retry_time: 6,
		retry_count: 25

If this does not help probably something else needs to change too.