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

Consider Shared Library Cache #58

Closed
ghost opened this issue Oct 18, 2016 · 2 comments
Closed

Consider Shared Library Cache #58

ghost opened this issue Oct 18, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 18, 2016

Create an in-browser LibraryCache

This Library Cache would be used for caching any framework/library used on a certain website and then be shared with any website that uses the same libraries.

For example:
I go to aaa.tld, and I get Angular 1.5.5 loaded. So Angular 1.5.5 will be downloaded to my browser.
Then I go to bbb.tld, and that website has indeed the Angular 1.5.5 as well. The browser needs to download it again.

However, both files have the same hash because they look exactly the same, and they come from the same origin (usually bower, npm or the developer's github repo).

My proposal would be to have a manifest.json or even a package.json/bower.json, where I would define which libraries I'd like to use in production.
Browser would lookup for these libraries on the LibraryCache, and if they are not there, the browser would download it from a source, or some other location.
Once downloaded, they will remain on the browser.

Possible problems @AdamModus and I thought:

  • Problem: in a case of a concatenated vendor.js file, the hash wouldn't be there. Solution: No need to use the vendor.js concatenated file anymore.
  • Problem: customised library files. Solution: Don't use customised libraries. Or if you really want to, you can identify the git repo of it.
@annevk
Copy link
Member

annevk commented Oct 18, 2016

Duplicate of #22?

@mozfreddyb
Copy link
Collaborator

This has been discussed in multiple places. #22 is the canonical issue, but misses some recent context that I'm going to add just now. (Hint: It's this great explainer: https://hillbrad.github.io/sri-addressable-caching/sri-addressable-caching.html)

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