Skip to content

[Feature Request] using CacheStorage to store image #5013

@lloydzhou

Description

@lloydzhou

🥰 Feature Description

#2393 #4574 #3994 #2433 #5002 #5015

using base64 string to save image content to localstorage, get error: QuotaExceededError

add new scheme: indexdb://{file_name} to read and write file in indexdb.

using CacheStorage to store image

🧐 Proposed Solution

add new scheme: indexdb://{file_name} to read and write file in indexed db

using CacheStorage to store image

  1. uploadImage using fetch
  2. hook upload api in serviceWorker: save in CacheStorage and return cache file url
  3. component using img show image content, then serviceWorker get from CacheStorage

📝 Additional Information

https://caniuse.com/?search=IndexedDB
image

https://caniuse.com/?search=cachestorage
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions