RFC - Move on-disk caching implementation to separate npm library #95
Replies: 6 comments
-
I'm wondering whether this would be helpful with GraphCMS? I know you have implemented another cache system here https://github.com/UnlyEd/GraphCMS-cache-boilerplate as well. What do you think? |
Beta Was this translation helpful? Give feedback.
-
The purpose of both caches is completely different.
Now, to answer whether the GraphCMS preset could benefit from it ... 🤔 |
Beta Was this translation helpful? Give feedback.
-
Make sense now. Thanks. |
Beta Was this translation helpful? Give feedback.
-
HybridCache has been added to gcms preset 98f6db3 |
Beta Was this translation helpful? Give feedback.
-
Could you share the results? Have you noticed any improvements? |
Beta Was this translation helpful? Give feedback.
-
I've just added the code source, but haven't used it and don't plan to 😉 But feel free to play around and let us know! |
Beta Was this translation helpful? Give feedback.
-
I've implemented a hybrid memory/disk cache storage at #92
It works locally and on Vercel.
It's meant to help caching stuff that is shared by several Next.js SSG pages during the server initial build, because in-memory caching won't work in such case.
I've used it to reduce from 140 Airtable API calls to only 7, and considerably decrease build time for the whole app.
It could make sense to implement it as a separate library at some point in the future, to help re-usage. But I don't have time for this now.
Also, I'm interested in getting feedback about the limitations of the current implementation. It's meant to be simple (and stay that way). It doesn't rely on any other caching library.
Beta Was this translation helpful? Give feedback.
All reactions