Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching? #9

Open
rythie opened this issue Mar 24, 2014 · 3 comments
Open

Caching? #9

rythie opened this issue Mar 24, 2014 · 3 comments

Comments

@rythie
Copy link

rythie commented Mar 24, 2014

Is there a way to make this cachable? currently the browser (firefox/chrome) at least, seem to do a fetch for every sparkline. Tried changing the code to use location.hash, but it still does it.

@tgvashworth
Copy link
Owner

There should be a way to CDN specific lines at least – I'm using Github to host this, and I suspect I'm not pointing at the CDN'd Github pages IP. That would cache specific URLs, but I'm not sure how to cache the svg files themselves.

One way might be to provide SVG placeholders with data attributes:

<embed
  src="//sparksvg.me/line.svg"
  data-points="0,4,7,10,8,12,9,7,3,0"></embed>

That's very off the top of my head – could it work?

@rythie
Copy link
Author

rythie commented Mar 25, 2014

Yes, I think that would work from the caching side at least.

@tgvashworth
Copy link
Owner

Cool. I seem to recall there was an issue getting data on the embed element from inside the SVG, but don't remember specifics. Fancy pull requesting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants