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

Compression

Next.js provides gzip compression to compress rendered content and static files. In general you will want to enable compression on a HTTP proxy like nginx, to offload load from the Node.js process.

To disable compression, open next.config.js and disable the compress config:

module.exports = { compress: false, }

Related

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