-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add cache to fetchRemoteFile and integrate with gatsby-source-contentful & gatsby-transformer-sqip #30391
Conversation
49dbf9e
to
967e544
Compare
967e544
to
e4eda3d
Compare
e4eda3d
to
78ed287
Compare
Hmm somehow it now wants to connect to localhost. Will check whats going wrong here. I restart the CI now in case that was an CI (network) error. |
@axe312ger is the image URL referring to https://localhost? or maybe you mocked fetchRemoteFile? |
5f941d6
to
fd1b66e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments, almost good to go. Is this being tested in the e2e test?
@wardpeet should we more the cache with the original fetchRemoteFile function? @KyleAMathews voted on merging in a conversation we had |
@wardpeet yes, it is covered by e2e |
@wardpeet while rewriting I figured out that base64 generation was not covered by the PR. I rewrote those parts, now everything is using fetchRemoteFile. Additionally I had to find out that fetchRemoteFile does not retry on server errors. As we should only request 100 assets at once from the Contentful Image API, I rewrote my old wrapper to use fetchRemoteFile, limit to 100 requests at the same time plus retry logic for server errors. I could now remove the In short: |
Do we have issues with the window temp dir? https://app.circleci.com/pipelines/github/gatsbyjs/gatsby/67858/workflows/a4b66993-8470-49a9-b442-d061d954cabc/jobs/766873?invite=true#step-107-1231 |
e88c89b
to
7b12c96
Compare
2ae4698
to
3f686a0
Compare
f441cb3
to
8bda979
Compare
@wardpeet thank you for the releases, it works fine on my projects as the number of CI fails got reduced. I'll set this to draft and clear up this PR from noise. |
closed in favour of #33461 |
Gatsby
Contentful
fetchContentfulAsset
GATSBY_CONTENTFUL_EXPERIMENTAL_REMOTE_CACHE
custom fs cache will now be used for every interaction with Contentful Image APIfix:fix moved to fix(contentful): asset download retry #33024[gatsby-source-contentful] Could not getDominantColor from image TypeError: Unable to download asset from http://images.ctfassets.net/... Cannot read property 'verbose' of undefined
SQIP
fetchContentfulAsset
function