You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm starting to use the iconic set with my current angular project ad i'd like to "preload" few icons and put them into the cache.
currently, it's not available and i need to load the icons the "normal" way.
it would be great to have something like
/** * parses data and adds it to the cache on success * @param {String} url url to cache it at * @param {String|Node} data SVG (data or string) to parse * @return {Boolean} true on success, * false on failure */functionpreload(url,data){// ...}
that would eventually parse the data and return Boolean result of the "preloading".
Would you implement that, or do you prefer PR?
this method would improve loading speed of my icons a bunch, since i could just inline the SVGs and "preload" them before injecting the icons :-)
what do you think?
The text was updated successfully, but these errors were encountered:
stryju
changed the title
expose the cache
allo cache "prefilling" / preloading
Jun 17, 2014
stryju
changed the title
allo cache "prefilling" / preloading
allow cache "prefilling" / preloading
Jun 17, 2014
This is implemented and documented on my fork.
It has an optional png argument to the end of the request to allow for a fallback to be specified to override the global fallback in SVGInjector. This allows it to work with cachekeys that don't represent urls ex. "jspm:foo.svg!"
@npbenjohnson I'm not JavaScript literate. Could you provide an example of what to place in the script to enable caching of the SVG. Currently, the code is working well but it reloads with the page reload, unlike the original img. I am aware that this is an old project, but any help would be most appreciated.
hey again ;-)
i'm starting to use the iconic set with my current angular project ad i'd like to "preload" few icons and put them into the cache.
currently, it's not available and i need to load the icons the "normal" way.
it would be great to have something like
that would eventually parse the data and return Boolean result of the "preloading".
Would you implement that, or do you prefer PR?
this method would improve loading speed of my icons a bunch, since i could just inline the SVGs and "preload" them before injecting the icons :-)
what do you think?
The text was updated successfully, but these errors were encountered: