lime icon indicating copy to clipboard operation
lime copied to clipboard

Cache for BINARY, TEXT?

Open TheoSabattie opened this issue 5 years ago • 2 comments

Hello',

Thanks for your awesome work! :)

I was wondering: why the cache is disallowed for BINARY and TEXT? cf. : Assets::loadAsset:

	public static function loadAsset(id:String, type:AssetType, useCache:Bool):Future<Dynamic>
	{
		#if (tools && !display)
		if (useCache && cache.enabled)
		{
			switch (type)
			{
				case BINARY, TEXT: // Not cached <<<--- yes, but why?!
					useCache = false;
(...)

Users have to make their own cache.
loadText and loadBytes should have another parameter to allow or not cache. Like all others methods (loadFont, loadImage, loadAudioBuffer, etc...).

If not, why?

Thanks in advance,

Théo Sabattié

TheoSabattie avatar Apr 19 '20 14:04 TheoSabattie

Hi, I don't know why the cache is disabled in this case; but the #if tools on top should mean that this code is valid only when building the lime executable itself. If so, its effects should happen only when you call lime via command line; that is, only during compilation of a project and not during execution of that project.

giuppe avatar Jun 27 '20 12:06 giuppe