This project includes scripts and configuration files to build the sample web app which showcases some of new browser APIs that make loading experience nearly instant and navigation more seamless. The app is also built for the referrence of how those new APIs are integrated into Next.js.
We cover following APIs:
We have following branches in this repository:
main
: All APIs are live, and it includes API latest changes.codelab
: Any features are not implemented yet. This branch is the initial point of the codelab.codelab-complete
: All APIs are live, This branch is the snapshot of the final state of the codelab.
We have the codelab introducing each API and demonstrating how to enable them by editing the sample app step by step. If you're going to walk through the codelab from the begining, please checkout the branch named codelab
in this Github repository. The branch is the snapshot of the initial state of the sample app, and the codelab guides you to implement each API along with the branch.
For local development
$ npm run dev
For production
$ npm run build
$ npm run start
Then visit http://localhost:3000/
When running your application locally with next dev, your headers are overwritten to prevent caching locally. https://nextjs.org/docs/going-to-production#caching
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
To check if BFCache works, you need to run the app with production mode.