-
Notifications
You must be signed in to change notification settings - Fork 5
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
stale data in production / race condition between Netlify and AWS when invalidating cache #101
Comments
Just rebuilt the site again and now everything is fine 🤷♂️ (although technically the hand should not be showing now since it is after the performance date 😬 ) |
Now testing locally, no {
event: {
id: 48,
title: "Tuesday's Tunes - 12/20/2022",
description: '<p>Our next show is coming soon! Check back for more details.</p>',
startTime: 1671584400,
endTime: 1671584400,
tags: [ 'tt' ]
}
} It's definitely there in the API call Even tried a cache busting query param const events = (await fetch(`https://www.analogstudios.net/api/v2/events?tag=tt&t=${new Date().getTime()}` So either an issue with
Really annoying either way.... |
Just tried with native |
So maybe for now, need to do this
Then going forward, the workflow would be
Unless I can somehow "step" this sequence, we may be tempting the cache gods to much. 😬 |
OK, so after a couple tests now with only invalidating CloudFront, and then initiating a Netlify, everything appears to be working as expected. so basically it seems I need to figure out a way to make sure Netlify only builds after CloudFront invalidation is complete. |
Overview
It often seems that after a build triggered by a chance in Contentful CMS, the next Netlify builds are still stale, and inconsistently sow. I think the issue is that updating content in Contentful does two things:
/api/v2/events
cacheSince the project build and pulls from the AWS API, if that invalidation hasn't finished yet, it will cause the Netlify build to use old data.
Details
It seems that these operations need to be sequential, not parallel. Not sure if that is possible via Contentful? (aka "step" functions). Or maybe have the project bypass the public API and go right API Gateway? That would expose the raw endpoint in the source code though, which is less than ideal. Or maybe it could be an environment variable?
In the meantime it will just mean I have to do a couple extra clicks, but would be nice to find a solution for this.
The text was updated successfully, but these errors were encountered: