nettybun / uvic-localstar

Local-first Starboard Notebooks via compiled Deno binaries
5 stars 0 forks source link

Feat: Patch network requests to proxy through the server to avoid CORS #12

Open nettybun opened 3 years ago

nettybun commented 3 years ago

Problem

There are two:

  1. CORS: People often want to connect to web resources by URL using either JS fetch() or Python pd.read_csv('https://...'). They'll run into CORS issues. Starboard works around this by providing a free CORS service, similar to https://cors-anywhere.herokuapp.com/.
  2. Excessive traffic: In notebooks everywhere (Jupyter, etc) people often re-run cells multiple times and this is so expensive but not well understood by people new to the concept/field. It's difficult to cache the download and avoid that traffic from within the notebook runtime.

Solution

Use Deno to make network requests, and also save the requests to disk to act as a cache.

Hiccups

Cache invalidation is hard. The users will know best (sometimes) if they need a fresh copy. There needs to be a thing in the client to show what assets are cached (date, size, cell, references, etc) and the ability to clear items from the cache.