[gatsby-source-contentful] Allow for cached content whenever possible
See original GitHub issueHi, this is my first issue, I could not find duplicates but sorry in advance if it exists. Also, thank you for a great plugin.
Summary
Allow for something like GATSBY_CONTENTFUL_OFFLINE=prefer
which always uses cached data (if exists) in development
Motivation
I’m working on a project with a pretty large amount of contentful data.
Having contentful data completely synced all the time is not a priority for my use case, so I would like a way to (at least attempt to) manually opt out of contentful re-sync whenever I add a dependency, change a gatsby-*.js
file, etc.
It will considerably speed development time for me. Hope this is possible.
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
gatsby-source-contentful
Make sure to regularly clean your cache when using Contentful's preview API. The following content type names are not allowed: entity , reference....
Read more >How to set GATSBY_CONTENTFUL_OFFLINE flag when ...
I tried to run the setting GATSBY_CONTENTFUL_OFFLINE=true to see if the site can be served from cache. Where to add this line in...
Read more >Developer Showcase Spotlight: Gatsby Bricks for LEGO builders
Gatsby Bricks is a a hobby project made with Contentful and Gatsby to showcase LEGO creations made by Dan Polant and his family....
Read more >How to setup Gatsby with Contentful CMS and Deploy on Netlify
If you have been working with a Gatsby blog site, you'd most likely know how to ... The gatsby-source-contentful allows us to pull...
Read more >5 Optimizations to Get Faster Gatsby Builds Today - Netlify
Most build systems, including Netlify, don't keep the Gatsby cache by default. However, you can install the Gatsby Cache Netlify Build Plugin to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @doronnac , thanks for the feature request! This would actually be a Gatsby core feature, not specific to the contentful plugin, and this is not currently possible. Right now, the entire cache for all plugins is invalidated if
gatsby-*.js
files or dependencies are changed, regardless of wether it’s needed or not. Work is currently being done to selectively invalidate the cache of only the plugins that need it, see https://github.com/gatsbyjs/gatsby/pull/8379. Once that’s merged though, it wont solve your problem. IMO we need a gatsby-node API for plugins to run logic to decide if their cache (or parts of their cache) should be invalidated.@doronnac maybe then should help an external cache/proxy/vcr for your test setup?
something like the “famous” VCR ruby gem i found (but not tested):