dumberjs / dumber-gist

A lightweight online IDE to write JS SPA prototypes in your own GitHub gists.
https://gist.dumber.app
MIT License
28 stars 2 forks source link

TBD move deps-resolver from front-end to backend #12

Closed 3cp closed 4 years ago

3cp commented 4 years ago

https://registry.npmjs.cf is bit slow.

Move to backend also means there are more choices at nodejs side, for example https://github.com/pnpm/pnpm/tree/master/packages/resolve-dependencies#readme

Then CloudFlare can cache resolved result (turn on sort query params) for few minutes to

  1. shield the backend a little bit.
  2. avoid constant reading from https://registry.npmjs.com.

TBD cache the raw result from registry.npmjs.com too?

3cp commented 4 years ago

Another option is to cache raw npm registry result in browser side. Set a TTL on those cache.

3cp commented 4 years ago

Ref https://github.com/pamelafox/lscache

3cp commented 4 years ago

Need UI feature to allow user to purge all npm registry cache. So that user can get latest package version info.

3cp commented 4 years ago

Moved to simple solution, at least for now, cache deps resolving result in client side for a day.