Hi everyone
I have the following task:
We have a CMS which content is being fetched by nuxt/gql. Instead of generating statically on netlify we now use On-Demand Builders. As I understand all the pages are being regenerated indepenent of caching, because the content might have changed.
Instead we could increase the TTL values for on-demand builders.
What I would like to achieve is to set a high TTL for all pages but when somebody in the CMS saves a specific entry, I want to reset the TTL for that one specific page. Thereby saving lots of unnecessary “builds”, both saving energy and server ressources and also keeping our function metrics low.
So my first question: Did I understand correctly and would my plan be somehow possible?
Further I read this:
I have no idea how to build a custom builder. Or is this really just a URL? In the end I just want to invalidate some cached content (or reset TTL, how things are called on netlify).
I also read about durable directives. Is this maybe what I need?
If this is what I need, could somebody give me some pointers what has to be done?
As far as I understand
I need to set a serverless function in the durable directive. (I hope to find some online tutorial how to do that, if you have good resources I would be very glad to know)
But what do I do from there on?
How would I force a page to have all its cache reset but normally don’t invoke an on-demand builder?
I would be very glad to gain some insights here.
Thank you in advance.
Cheers