MiroHibler / meteor-preloader

A Meteor "lazy-loader" for external .js and .css libraries
75 stars 3 forks source link

CDN, fallback to local. #27

Open tcastelli opened 9 years ago

tcastelli commented 9 years ago

Hello again! Due to certain circumstances I've seen how the CDN servers were out, and all my routes depending on that were not loading correctly. Would it be possible to add a fallback place to load them from public folder in that case? (or if anyone has an idea of how to get this working with current functions i'm listening :)

MiroHibler commented 9 years ago

Sounds like a good idea. What should be the trigger to switch to public dir? A timeout?

tcastelli commented 9 years ago

Yes, i think the current timeout system for sync files would work perfectly to trigger the fallback location (well, maybe the timeout could be set for each file, not sure how much work would that involve).

Update: Well, also getting an error from xmlhttprequest would trigger the event