Vue file browser caching
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=36812)
</details>
<!--IssueSummary end-->
With the Vue file browser hitting production its time to think of the next steps :smile:
Caching! :tada:
The backend could probably cache (not sure how this is done with GraphQL) but I think the frontend can cache a lot as well. When we fetch from the GraphQL endpoint we send across a ref (usually branch name) - what if we changed this and sent a `sha` instead? It would return the same content, however the frontend could then cache the results of this in local storage or probably in IndexedDB.
When the frontend then sends a GraphQL request with a sha, we can first check the cache and return if it exists. For repositories that change a lot - this may not be great. But for certain folders that aren't changed very often - it could save a server request.
We could also cache the commit for each row in the same way and return that - though this may get a bit more complicated but could be a huge win!
Final though - would it be possible to move this caching onto a web worker? :thinking:
/cc @andr3
issue