服务器端的 Nextjs 主动缓存

时间:2021-06-24 08:23:27

标签: node.js reactjs caching next.js server-side-rendering

我正在构建一个 next.js (10.2) 应用程序, 当我在 dev 中运行应用程序时。模式,它正在积极缓存服务器端代码。

重现:

export const getStaticProps = async ({ params }) => {
  return await api.get('test'); // This part of changes requires a page refresh.
}

function Home() {
  return <div></div>
}

如果我将 await api.get('test'); 更改为 await api.get('test2');,我必须刷新浏览器。

是否可以在开发模式下配置此缓存策略?

0 个答案:

没有答案