Next.js Logo
官方文件使用案例英文官網

Documentation

  • Getting Started
  • 基礎功能

    • 頁面
    • Data Fetching

      • Overview
      • getServerSideProps
      • getStaticPaths
      • getStaticProps
      • Incremental Static Regeneration
      • Client side
    • Built-in CSS Support
    • Layouts
    • Image Optimization
    • Font Optimization
    • Static File Serving
    • Fast Refresh
    • ESLint
    • TypeScript
    • Environment Variables
    • Supported Browsers and Features
    • Handling Scripts
  • 邁向成品

API Reference

  • CLI
  • Create Next App
  • next/router
  • next/link
  • next/image
  • next/script
  • next/head
  • next/amp
  • next/server
  • next/future/image
  • Edge Runtime
  • Data Fetching

    • getInitialProps
    • getServerSideProps
    • getStaticPaths
    • getStaticProps
  • Static Optimization Indicator
  • next.config.js

    • Introduction
    • Environment Variables
    • Base Path
    • Rewrites
    • Redirects
    • Custom Headers
    • Custom Page Extensions
    • CDN Support with Asset Prefix
    • Custom Webpack Config
    • Compression
    • Runtime Configuration
    • Disabling x-powered-by
    • Disabling ETag Generation
    • Disabling HTTP Keep-Alive
    • Setting a custom build directory
    • Configuring the Build ID
    • Configuring onDemandEntries
    • Ignoring ESLint
    • Ignoring TypeScript Errors
    • exportPathMap
    • Trailing Slash
    • React Strict Mode
    • URL Imports
    • Build indicator

Disabling ETag Generation

Next.js will generate etags for every page by default. You may want to disable etag generation for HTML pages depending on your cache strategy.

Open next.config.js and disable the generateEtags option:

module.exports = { generateEtags: false, }

Related

Introduction to next.config.js: Learn more about the configuration file used by Next.js.