mainmatter / ember-hotspots

Create interactive prototypes from scratch and design mockups using little code but the full power of the Ember.js ecosystem.
https://simplabs.github.io/ember-hotspots/
MIT License
5 stars 0 forks source link

Preload images #4

Open pichfl opened 4 years ago

pichfl commented 4 years ago
marcoow commented 3 years ago

I'd strongly recommend adding ember-cli-workbox as a dependency here and preloading the images with that. The current implementation with the <link rel="preload"> tags has significant performance implications and I'd say service workers are kind of the standard solution for preloading anything now.

pichfl commented 3 years ago

I was hoping to keep this addon as light and free of dependencies as possible, but I think you're also right.

This issue however is not about prefetching in the background, but actually blocking application init until all assets are loaded. While this is not good behavior for an existing ember app, it is sensible to do in a blank project that exists just as a prototype.

marcoow commented 3 years ago

So the service worker will preload once the application has started but you can of course call the service's load in the application route's model to make sure all images are in fact loaded before the app starts up.