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

optimal implementation of caching logic #10149

Closed
wants to merge 6 commits into from

Conversation

vladgaidukov
Copy link

update logic for lazy loading files

*/

var Cache = {

enabled: false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... Why did you removed enabled?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the cache must be enabled permanently. This will eliminate the possibility of performing repeated requests for file downloads.
If you think that there must be an option to disable the cache, I will add this, but I think that the default set it enabled. What do you think ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to #6834

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the ability to enable or disable the cache

@vladgaidukov
Copy link
Author

Added the ability to enable or disable the cache

@looeee
Copy link
Collaborator

looeee commented Nov 26, 2016

@vladgaidukov Just looking over this quickly - what improvements does it give over the current cache?

@vladgaidukov
Copy link
Author

vladgaidukov commented Nov 27, 2016

@looeee In the current implementation, the file is cached only after downloading it.
For example if you download 10 same files in the loop, there will be created 10 xhr requests.
In my implementation will be created only one xhr request and onload events for all 10 files will be called immediately after loading the first.

Resolved conflict:
#	src/loaders/FileLoader.js
@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 11, 2018

Solved via #12434

@Mugen87 Mugen87 closed this Feb 11, 2018
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

Successfully merging this pull request may close these issues.

5 participants