codebox-npm
codebox-npm copied to clipboard
Caching
What did you implement:
New option CODEBOX_CACHE
that allows npm installs
to now cache the dependencies so that you do not have to rely on the public registry.
How did you implement it:
- Checks if cache option enabled
- Stores an
index.json
file within a separate S3 cache bucket - Scheduled lambda runs every hour to then cache all versions of each package.
- It checks the revision against public registry if changed will refetch the packages and update the cache.
How can we verify it:
- Enable cache
- Deploy and attempt use and npm install packages
- The cache will eventually populate and any further packages will then use the cache instead
Todos:
- [x] Write tests
- [x] Write documentation
- [x] Fix linting errors
- [x] Tag
ready for review
orwip
Is this a breaking change?: NO
Any chance of this PR getting merged? We would love to get the added benefit of caching.
Add another +1 to the request for caching. Makes a big difference in CI build environments that are continuously building.