Ban `ObjectStorage#use_file` and devise alternative solution
Description
We've been working on gitlab-ee~2977590 issues for moving away from FilesStorage, however, today we still have ObjectStorage#use_file method, which is being used to fetch data from ObjectStorage to FileStorage, for the following usage.
- Artifact Browser (Fetching a metadata from remote storage to show contents of artifacts)
- PagesWorker (Fetching an artifact from remote storage to deploy to pages)
In this issue, we discuss how we can remove ObjectStorage#use_file and devise alternative solution
Proposal
Links / references
Old titie: Smart cache for ObjectStorage#use_file method
ObjectStorage#use_file is useful when fetching data from ObjectStorage to FileStorage. Currently, we've been using this method for
- Artifact Browser (Fetching a metadata from remote storage to show contents of artifacts)
- PagesWorker (Fetching an artifact from remote storage to deploy to pages)
However, use_file pulls the same object from ObjectStorage every time, regardless of the previously cached file still exists in FileStorage.
We can store the cache information to Redis and reuse the previously cached file as long as it's alive.
This will improve the performance of artifacts browser.