Assets.loadText cache

Hi,
any particular reason why loadText is not cached ?
tried to preload some json files + images for spritesheets but then realised that loadText dont save result in cache. Or I am using wrong method for loading json files ?

thank you

If it is preloaded (thx to project.xml) you can use Assets.getText.
Otherwise, you can add it manually in the cache after you have loaded the file (Assets.cache.set() if I’m correct).

But you are right, the useCache parameter is missing from loadText. I think we can add it easily.

1 Like

@loudo thanks didnt know you can add stuff manually in cache

but was mostly curious why cache was not used as there is even comment about cache param there :slight_smile: was thinking maybe there is some reason for that

is has been forgotten imho

A few (6) years ago I encountered the same problem:
Asynchronous to Synchronous resources

Hope it can help

Does Asset.cache.set() even exist??

Yes? Were you looking at the OpenFL AssetCache?

Yeah
I forgot that lime’s asset cache existed