Next.js Discord

Discord Forum

Does unstable_cache do anything when called from Pages Router?

Answered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
I'm calling an async function wrapped in unstable_cache from getStaticProps inside the Pages router. Does the cache do anything in that case or not, since it only runs at built-time?
Answered by joulev
so yeah, you get the answer. unstable_cache simply doesn't work in the pages router because it follows an entirely different caching system
View full answer

3 Replies

does it even work? im fairly certain it will throw an error
Northeast Congo LionOP
You're right, it threw an error
so yeah, you get the answer. unstable_cache simply doesn't work in the pages router because it follows an entirely different caching system
Answer