Next.js Discord

Discord Forum

nested 'use cache'

Unanswered
Ant posted this in #help-forum
Open in Discord
AntOP
I was exploring the new 'use cache' today and I was faced with something that I am very curious about.

Let's say I have a card component that has inside it some information about a product, the entire data of the product can be cached they are not critical to be updated on the spot, but the only part where it must show the newest value of is the price.

My question is, how do I cache the entire component except for the price part or how do I specify a different cache life for the price component that would override the use cache wrapping the card.

I feel like I am approaching this in a dumb way so there must be a smarter version to do that and I am curious to know what it is.

0 Replies