gatsby-uc / gatsby-source-s3

A Gatsby plugin to source objects and images from AWS S3. Compatible with Gatsby v4.
MIT License
19 stars 8 forks source link

feat: caching #16

Open robinmetral opened 4 years ago

robinmetral commented 4 years ago

This is already handled by Gatsby pretty well, but the Cache API can be leveraged to make sure the pulled images are persisted between builds.


Relevant Gatsby PRs about caching for plugins:

Relevant docs:

Vacilando commented 3 years ago

This would really be lovely - potentially a huge time-saver.

Cache API by itself very easy to use:

let obj = await cache.get(cacheKey) ... await cache.set(cacheKey, obj)

Though I am not sure how complex will it be to use it for each and every fetched image.

robinmetral commented 3 years ago

That sounds great @Vacilando! I've been pushing this back because I never really used the Gatsby cache explicitly 😅—do you want to open a PR for it?

Vacilando commented 2 years ago

@robinmetral I've looked into caching imageFile in onCreateNode() - then realized that if the Gatsby flag PRESERVE_FILE_DOWNLOAD_CACHE the image files are already being used from cache (thanks to the use of plugin gatsby-source-filesystem).

Where else do you see we could use caching to improve the cache efficiency?

moonmeister commented 2 years ago

Thanks for your interest in this project. This plugin is moving into the Gatsby User Collective and this repo will be archived. Please open an issue in that repository, submit a PR if you'd like to see this implemented, or Join us on Discord if you have questions!