-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Files loading slowly and preloading #453
Comments
Hey @danielrhodes, If you wanted a way to manually trigger the prefetch of a file, you would first need to grab the file info (which allows preview to determine how to access the file's content), and then use the this Hope this helps! |
Using collections already. Have not tried the I'm not sure if collections has made things better as I still find lots of cases where the file takes a long time to load. My guess is that perhaps I am doing things incorrectly. In my interface, a user can click a file name from a list and then preview a file in an always visible previewer. So when a user clicks on a file, it does a |
Would it be possible to see an example of your code? If you're using the same token each time you call Based on your use case I would check out the Content Explorer, which essentially does file navigation + preview. documentation and codepen example |
Sure, here is the code. The In this case, onSoftSelectDocument(doc, loadPreview) {
if (loadPreview == undefined) {
loadPreview = true
}
// Don't do anything if selected doc is already this doc
if (this.selectedDocument != null && this.selectedDocument.id == doc.id) {
return;
}
this.selectedDocument = doc;
var collectedFileIds = _.map(this.documents, 'box_document_id');
// If we have an access token, preview it
if (window.boxAccessToken !== undefined && loadPreview === true) {
if (this.preview == null) {
this.preview = new Box.Preview();
this.preview.updateCollection(collectedFileIds);
this.preview.prefetchViewers();
}
this.preview.show(String(doc.box_document_id), window.boxAccessToken, {
container: '.preview-container',
showDownload: true,
header: 'light',
logoUrl: 'http://',
collection: collectedFileIds
});
}
}, |
Hey Daniel, |
@jeremypress Any updates on this? |
Hey @danielrhodes we're in the middle of some tech debt/cleanup work and will get to this + related performance enhancements later on in the quarter. I'd expect some updates in a month or so. |
Hello, any update on this ? |
When viewing many files in succession, there is often a long delay while a file loads. Network issues aside, is there any way to preload files? When looking through the source, it seems there is some mention of this, but I couldn't get anything to make a noticeable difference in loading time.
What would your recommendations be here? Would also be glad to make a PR if necessary.
The text was updated successfully, but these errors were encountered: