jaicab / localFont

Implement localStorage web font caching in seconds
http://jaicab.com/localFont/
MIT License
848 stars 22 forks source link

localFont for multiple domains #6

Closed arvindr21 closed 9 years ago

arvindr21 commented 9 years ago

Hello,

Thanks for the localFont project.

I am aware that local storage is limited to domain, but is there any way we can cache fonts so that it can be used by multiple domains instead of just one. (I am aware of browse cache, wanted to know if there is any other way).

Thanks.

jaicab commented 9 years ago

I'd need to check, but I imagine that changing the the absolute path (by default /font.css) with a full URL wouldn't be a problem as long as you allow cross-origin requests with that domain. I think Firefox had some issues with that. If I'm not mistaken that is how the guys at Smashing Magazine set it up, because they used a different domain for the assets (to use a CDN for example). I'll make a couple of tests though.

arvindr21 commented 9 years ago

Thanks, that would be helpful.

jaicab commented 9 years ago

I have been using localFont in a number of projects and as long as the cross origin requests are permitted on the domain used to serve the files you should have no problems whatsoever. :+1: