codebox-npm icon indicating copy to clipboard operation
codebox-npm copied to clipboard

Caching

Open jonsharratt opened this issue 7 years ago • 2 comments

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 or wip

Is this a breaking change?: NO

jonsharratt avatar Apr 24 '17 15:04 jonsharratt

Any chance of this PR getting merged? We would love to get the added benefit of caching.

WalterWeidner avatar Jun 22 '18 19:06 WalterWeidner

Add another +1 to the request for caching. Makes a big difference in CI build environments that are continuously building.

WetHippie avatar Sep 28 '18 02:09 WetHippie