DEV Community

Discussion on: Configuring WordPress as a headless CMS with Next.js

 
jrhager84 profile image
Joel R Hager

You could also use SWR to serve stale state after the page time exceeds the last regen, it'll serve one stale state, and then trigger a revalidate in the background.

Thread Thread
 
adamsoderstrom profile image
Adam Söderström • Edited

I think it still would be wise to use GraphQL, since ISR from Next still pre-bundles the complete chunk of static props.

If you then want to slim down the REST response, you'll have to do one of the following:

  • manually "chopping off" data that is not used in the NextJS application.
  • Add query parameters to filter it in the WP-response.