Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache for BINARY, TEXT? #1395

Open
TheoSabattie opened this issue Apr 19, 2020 · 2 comments
Open

Cache for BINARY, TEXT? #1395

TheoSabattie opened this issue Apr 19, 2020 · 2 comments

Comments

@TheoSabattie
Copy link

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é

@giuppe
Copy link
Contributor

giuppe commented Jun 27, 2020

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.

@player-03
Copy link
Contributor

Maybe some concern about filesize? But that doesn't make sense. The other asset types could be large files too.

For backwards compatibility we'd probably have to default to no cache, but I don't see why we couldn't add the option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants