basket.js
basket.js copied to clipboard
Template support?
Do you think adding support for templates (.htm files or otherwise) would fit with this library?
If you used an xhr request to get the template you could know when the template was loaded. And everything else would fall in with the script caching as well.
Just a thought.
I think this falls under a general "should we support resources other than scripts" question. We've been getting these a lot lately. @sindresorhus @peol @wibblymat Implementation wise this isn't hard. Should we do it or punt?
I don't see much reason not to. :+1:
I don't mind at all.
What would happen when trying to store a template that is 0.5kB and the oldest one is a script on like 150kB. We really need some smart logic around what is scrapped and what's not. I'll happily take the overhead fetching the template than dumping the heavy script for example :)
That seems like a good question even if we are only talking about scripts :)
On 22 January 2013 15:17, Andrée Hansson [email protected] wrote:
I don't mind at all.
What would happen when trying to store a template that is 0.5kB and the oldest one is a script on like 150kB. We really need some smart logic around what is scrapped and what's not. I'll happily take the overhead fetching the template than dumping the heavy script for example :)
— Reply to this email directly or view it on GitHubhttps://github.com/addyosmani/basket.js/issues/72#issuecomment-12548818.
True, it just hit me when I started commenting.
I'll allow it! :)
If we do go down this path it would be useful to discuss some of the challenges involved:
- CSS? https://github.com/addyosmani/basket.js/pull/28, https://github.com/addyosmani/basket.js/issues/60
- images http://robnyman.github.com/html5demos/localstorage/
- Other/any files.
It would be interesting to see basket become a generic asset cacher.