Skip to content
This repository has been archived by the owner on Mar 1, 2020. It is now read-only.

How goes it? #2

Open
tomByrer opened this issue Mar 19, 2013 · 4 comments
Open

How goes it? #2

tomByrer opened this issue Mar 19, 2013 · 4 comments

Comments

@tomByrer
Copy link

I'd like to encourage you guys to re-start this project when you have the time; I think it would make a great impact, as more & more websites use various libs. I thought of this being helpful several times in this thread: h5bp/html5-boilerplate#1327 (comment)

@thomasdavis
Copy link
Member

It worked well, when I had it up and running.

I can re-investigate it now, thought the problem is, we can only rewrite google and cdnjs urls and not file names themselves. Such that if they are pulling jquery.1-2.1.js from their own servers we can't actually make the assumption that it is the same as our cdn version.

With a bit of help from the community, we could write a pretty rock solid version of the extension.

It could also be nice to include the cdnjs home page locally such that you can have over 300 scripts even when your offline.

@thomasdavis
Copy link
Member

https://bugs.webkit.org/show_bug.cgi?id=62015

Would be nice to start some momentum for such an idea

@tomByrer
Copy link
Author

Thanks for the reply!

I can re-investigate it now, thought the problem is, we can only rewrite google and cdnjs urls and not file names themselves.

May I suggest adding MS's CDN also? *.microsoft.com, & Skype.com use that CDN, & it is publicly usable. (Though I would caution anyone from using that CDN, due to a set of recent downtimes...)

Such that if they are pulling jquery.1-2.1.js from their own servers we can't actually make the assumption that it is the same as our cdn version.

Easily solved by MD5/SHA checksum hashtags, though elegant procedures might not be so easy. Maybe have a filename.MD5 text file in the same directory would help, or store those filesource-hash pairs somewhere? BTW, how am I certain that you are serving the correct non-adulterated versions at CDNJS? ;)

https://bugs.webkit.org/show_bug.cgi?id=62015 Would be nice to start some momentum for such an idea.

I'm not so sure if this the best approach; forcing a browser manufacturer to be responsible for what to build-in. I don't think they'd be happy either ;). Though I do love your & his root idea of long-term storage, & keeping the pre-digested bytecode version is ingenious... Brainstorms:

  • Encourage browser manufacturers whitelist small handful of domains & filetypes to keep in a separate storage, like a 3rd long-term cache (opposed to memory & short-term HD cache). Who gets whitelisted can get political though...
  • 3rd party plug ins like you're doing, with a 4th party whitelisting domains &/or full filepaths aliases (like how AdBlock Plus works with subscriptions).
  • Personally, I would only cache requested libs; jQuery alone is releasing new versions every month or so, & webmasters often don't upgrade their linked versions until there is a need to (in their eyes & allowed time). So IMHO pre-packaging the newest popular libs or even all of them might be counter-productive.
  • Simply encourage users to enlarge their HD cache, & get more web devs to use the same library CDNs. Not best, but simplest.

@tomByrer
Copy link
Author

tomByrer commented Apr 3, 2013

Perhaps use a library like basket.js, that caches scripts with localStorage?

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

No branches or pull requests

2 participants