Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

feat: caching #16

Open
robinmetral opened this issue Mar 20, 2020 · 4 comments
Open

feat: caching #16

robinmetral opened this issue Mar 20, 2020 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@robinmetral
Copy link
Contributor

robinmetral commented Mar 20, 2020

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:

@robinmetral robinmetral added enhancement New feature or request help wanted Extra attention is needed labels May 15, 2020
@robinmetral robinmetral changed the title chore: caching feat: caching May 18, 2020
@Vacilando
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

Vacilando commented Dec 3, 2021

@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
Copy link
Contributor

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants