Resources clarification

What are resources.http_cache and resources.uri used for exactly? I first assumed they were for HTML5 builds, but I think I may be wrong and they matter for other features as there is also html5.use_app_cache.

I’m assuming resources.uri can be set to for another domain, such as a cdn, to load game data from, and then it matches whatever protocol the current page is. Is this wrong assumption? I get the feeling it is. Is it related to http.request ?

For resources.max_resources, what counts as a resource? I’ve read that individual fonts for example count as two resources.

For collection_proxy.max_count this is max per single collection or? Same for some of the other max_count - are these all at once over all collections or only per collection?

Could I get the use of (DEF-1676) archive_location_prefix and archive_location_suffix explained? If I understand then these are the settings you define for if you wish to host the archive on another site such as a CDN, and not resources.uri.

1 Like

These are questions for @sven or perhaps @FredrikMalmer.

1 Like

Still need more explanations for these please.

1 Like

Hey! I’m going to answer the easiest one first, will try to get back to you on the other settings, need to read up on them myself (look into the code :slight_smile: ).

[quote="Pkeod, post:1, topic:1956]
Could I get the use of (DEF-1676) archive_location_prefix and archive_location_suffix explained? If I understand then these are the settings you define for if you wish to host the archive on another site such as a CDN, and not resources.uri.
[/quote]
That is correct. When you bundle your HTML5 builds the game content will be split up into some data file that will be requested by the engine at boot. It might be beneficial to host these data files on a separate server, like CDN, and that’s where these settings come in. A dumb example of its usage;

Say you are hosting your game on http://baba-booey.fcc/my-cool-game/, but want to put the data files on a CDN, like http://howard.cbs/data/*… Then you would set your game.project to;

[html5]
archive_location_prefix = http://howard.cbs/data/

Then some day you update your game, but realise that the data files being served are cached! :cold_sweat: archive_location_suffix to the rescue! You can use it to append stuff at the end of the archive URLs, such as a hash or a timestamp to force the server to serve fresh/non-cached content:

[html5]
archive_location_suffix = ?a_timestamp_here_maybe

Maybe a bit convoluted example, let me know if it needs further explanation. :slight_smile:

3 Likes

That makes perfect sense! Thank you for explaining those ones!

I found the meta.properties file, and it made me realize that you can hover the labels of the game.project file for tooltip hints. I know I noticed before but forgot. This file is a useful reference for valid types. It’s what needs to be edited to add the non-exposed properties that Defold Engine uses.

I’m going to guess that resource.http_cache will cache any HTTP requests. And then it would be your responsibility to add a timestamp at the end if you want a fresh result of a link.

resource.uri appears to be the relative path of the game.project file. At least that’s what the hint suggests. Maybe if your don’t want to put it in the root of your project folder? Even with the description it’s still not clear to me.

It would still be nice to know what counts as a resource. Maybe add a way to print the current number of resources while running?

I have on my todo to test the different situations of the max values and see what’s allowed based on the settings.

I think I imagined html5.use_app_cache …