Skip to content

Performance: Preload file blobs where possible

Created by: umpox

Description

Goal: Render code views faster

Reason:

  • Fetching file contents takes a long time
  • We should start fetching as soon as possible
  • If we can begin fetching as soon as a user hovers over a link, then we will have the file contents ready sooner, and we can render sooner.

Note:

  • Need to ensure that we do this efficiently. E.g. if we have a prefetch request in flight, we should reuse that if we try to render before it resolves.
  • Might be useful to abstract this. We could have a <FileLink /> component that handles all this in one place.
  • Need to work out how eager we are to prefetch, 50ms hover wait before fetching? More? Less?
  • This might be affected by future search/file UX changes