effigy.im icon indicating copy to clipboard operation
effigy.im copied to clipboard

Implement Blockie Caching in Cloud Storage

Open sweep-ai[bot] opened this issue 5 months ago • 2 comments

This pull request was created by Sweep to resolve the following request by @harperreed:

Let's store the resulting blockies in cloud storage so if someone comes in and there is a cached blockie it just redirects to that.

Continue chatting at https://sweep-chat-demo.vercel.app/c/2965eff4-8bdf-4fb2-bffa-2910223fd4e5.

Purpose

This pull request introduces a new feature to cache generated Blockies in cloud storage, improving the performance and reliability of the Effigy.im application.

Description

The changes in this pull request include:

  1. Introducing a new cloudStorage.js module that provides functions to check if a blockie exists in cloud storage, upload a blockie to cloud storage, and generate the URL for a cached blockie.
  2. Modifying the index.js file to check if a blockie is already cached in cloud storage before generating a new one. If a cached blockie is found, the function will redirect the user to the cached version.
  3. Updating the index.js file to upload the generated blockie to cloud storage after it has been created.

Summary

  • Added cloudStorage.js module with functions to manage blockie caching in cloud storage
  • Updated index.js to check for cached blockies and redirect to them if available
  • Updated index.js to upload generated blockies to cloud storage

Summary by CodeRabbit

  • New Features

    • Enhanced avatar generation process with cloud storage integration for caching blockies.
    • Added fallback mechanism to fetch ENS avatars if cached blockies are unavailable.
    • New functionalities for managing blockies in cloud storage, including existence checks and uploads.
  • Bug Fixes

    • Improved response times for avatar retrieval by bypassing unnecessary processing for cached blockies.

sweep-ai[bot] avatar Sep 01 '24 19:09 sweep-ai[bot]