Ban `ObjectStorage#use_file` and devise alternative solution

Description

We've been working on GCP Migration 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.

  1. Artifact Browser (Fetching a metadata from remote storage to show contents of artifacts)
  2. 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

  1. Artifact Browser (Fetching a metadata from remote storage to show contents of artifacts)
  2. 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.

/cc @ayufan @grzesiek

Edited Mar 13, 2018 by Shinya Maeda
Assignee Loading
Time tracking Loading