Skip to content
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

disable data caching for hub homepage #56

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

rccsousa
Copy link
Collaborator

@rccsousa rccsousa commented Oct 15, 2024

Why:

  • as mentioned on deployment build is not refreshing content properly #55 , content was being cached and not fetching from the data based, which implied a redeployment in order to display fresh content.
    How:
  • setting dynamic to force-dynamic and revalidate to 0 disables caching and forces re-rendering/new data fetches on new requests as per NextJS documentation
  • collections were missing revalidation hooks that leverage NextJS revalidatePath for incremental static regeneration;

Copy link

netlify bot commented Oct 15, 2024

Deploy Preview for content-sub ready!

Name Link
🔨 Latest commit b43901f
🔍 Latest deploy log https://app.netlify.com/sites/content-sub/deploys/670e48a59ae55a00088cf6e4
😎 Deploy Preview https://deploy-preview-56--content-sub.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

- update .app/page.tsx dynamic and revalidation to reflect constant
  rendering
@rccsousa rccsousa marked this pull request as ready for review October 15, 2024 16:29
@rccsousa rccsousa requested a review from davelange October 16, 2024 11:42
@rccsousa rccsousa merged commit d0c6fd5 into main Oct 16, 2024
5 checks passed
@rccsousa rccsousa deleted the rs/change-hub-caching branch October 16, 2024 12:50
@davelange
Copy link
Contributor

So blog post/podcast pages are cached and updated with revalidePath, and the homepage is always fresh right? Makes sense 👍

@rccsousa
Copy link
Collaborator Author

So blog post/podcast pages are cached and updated with revalidePath, and the homepage is always fresh right? Makes sense 👍

exactly! on the previous iteration it was just rendering as a static page so had to redeploy to fetch everything. wasn't leveraging next JS dynamic rendering

this way it is always dynamic, even using github as storage, as soon as the files land on the repo they're rendered even if Netlify is redeploying the build due to new commits by Octokit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants