DEV Community

Discussion on: NextJS, Contentful CMS, GraphQL, oh my!

bholmesdev profile image
Ben Holmes Author

Right. That's mainly because Contentful is a CMS, so it's meant to be your content editor as well as your storage solution. In your case, it sounds like you'll never update these entries again once they've been saved, so you're probably just looking for a data storage solution. I haven't investigated server-side caching with Next, but it looks like they have an example you can clone right here. Your idea definitely isn't impossible! It was just be a lot of work to set up and maintain. You'd likely run into free tier limits as well, since you'll be writing a lot of entries at a time.

Thread Thread
bairrada97 profile image

Exactly, I have to investigate more, Its a thing that I plan to do later in my project. Because the data will update every 15s but once the day is over that same data will not be updated ever again, and a new day starts with fresh data to be updated every 15s again. And I dont want to use headless CMS because If I have 10k online users and every single of them start to click on every day from last 5y, I'll reach the limit of calls.
Since Im using Vue 3, maybe I can create a db on server with the power of reactivity and once day is over I make a post to that db with the data , and if the user clicks on a day that is lesser than today will grab data from db, if not will grab data from third party api.
And maybe with service workers or with SS cache I can make it work. If only 1 user visits that page from 3y ago, 10k users will see instant on browser because Its already in cache.

Well this is what Im thinking dont know if will work or not