-1

So I want to use wordpress as CMS to manage the content and React to develop a website for a client.

I know that using Graphql with Gatsby or Next.js its possible to fetch de CMS content and generate static pages for every item and when the user go to the website it loads instantly without having any loading time. This is perfect but when it comes to deploy the website it has to be on a service like Netlify or similar to trigger a new build whenever the CMS is updated. This is a problem because the client wants to use the same hosting service for the CMS and the website.

Other option is to load all the data when the user visits the site for the first time and save it with Context API. But this can take a long time and it's really bad for user experience...

So, is the there any way to fetch the data nedded and the user sees the page rendered without having loading time? In order to be able to deploy the static files to the client hosting service together with the wordpress CMS.

Many thanks in advance, and sry if I couldn't be more explicit.

FASP
  • 45
  • 1
  • 2
  • 7

1 Answers1

0

What you need is called webhook. Basically, a webhook is a way for an application to notify another application when a new event has occurred in real-time such as creation, modification, deletion of a post, or any kind of content.

Netlify (or similar), since it's a CD (Continuous Deployment) tool, adds the feature because all content is a PR (Pull Request) in your Git repository so, once a push to a master branch is done, a deploy is triggered.

In the same way, you can build a webhook from scratch in any CMS, of course you'll need development on both sides to achieve the same functionality, but it's much better than loading the content asynchronously which will have a huge negative SEO impact.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67