Q10: What is Automatic Static Optimization in the Pages Router?

Next.js automatically determines if a page can be rendered statically. If a page has no blocking data fetching methods (getServerSideProps or getInitialProps), Next.js pre-renders the page to static HTML at build time automatically.

Key Takeaways
  • Opt-in by omitting server-side data fetching functions.
  • Generates static HTML files for maximum CDN performance.
Knowledge Check

How do you enable Automatic Static Optimization for a page file inside pages/?