• Product Introduction
  • Quick Start
    • Importing a Git Repository
    • Starting From a Template
    • Direct Upload
    • Start with AI
  • Framework Guide
    • Frontends
    • Backends
    • Full-stack
      • Next.js
      • Nuxt
      • Astro
      • React Router
      • SvelteKit
    • Custom 404 Page
  • Project Guide
    • Project Management
    • edgeone.json
    • Configuring Cache
    • Error Codes
  • Build Guide
  • Deployment Guide
    • Overview
    • Create Deploys
    • Manage Deploys
    • Deploy Button
    • Using Github Actions
    • Using CNB Plugin
    • Using IDE PlugIn
    • Using CodeBuddy IDE
  • Domain Management
    • Overview
    • Custom Domain
    • HTTPS Configuration
      • Overview
      • Apply for Free Certificate
      • Using Managed SSL Certificate
    • Configure DNS CNAME Record
  • Observability
    • Overview
    • Metric Analysis
    • Log Analysis
  • Pages Functions
    • Overview
    • Edge Functions
    • Cloud Functions
      • Overview
      • Node Functions
  • KV Storage
  • Edge AI
  • API Token
  • EdgeOne CLI
  • Pages MCP
  • Integration Guide
    • AI
      • Dialogue Large Models Integration
      • Large Models for Images Integration
    • Database
      • Supabase Integration
      • Pages KV Integration
    • Ecommerce
      • Shopify Integration
      • WooCommerce Integration
    • Payment
      • Stripe Integration
      • Integrating Paddle
    • CMS
      • WordPress Integration
      • Contentful Integration
      • Sanity Integration
    • Authentication
      • Supabase Integration
      • Clerk Integration
  • Best Practices
    • Using General Large Model to Quickly Build AI Application
    • Use the DeepSeek model to quickly build a conversational AI site
    • Building an Ecommerce Platform with Shopify
    • Building a SaaS Site Using Supabase and Stripe
    • Building a Company Brand Site Quickly
    • How to Quickly Build a Blog Site
  • Migration Guides
    • Migrating from Vercel to EdgeOne Pages
    • Migrating from Cloudflare Pages to EdgeOne Pages
    • Migrating from Netlify to EdgeOne Pages
  • Troubleshooting
  • FAQs
  • Contact Us
  • Release Notes

Configuring Cache

EdgeOne Pages uses edge networks to cache your static resource content worldwide, which is closer to users than storing on the origin server. This can reduce server load and improve website performance, thereby increasing your website's access speed.


Browser Cache

To provide your users with a high-quality access experience, Pages applies differentiated handling to the browser cache policy for static files:
Files with hash (e.g., main.a1b2c3.js): Set max-age=31536000 (one year) to achieve long-term caching.
Files without hash (e.g., index.html): Set max-age=0 to ensure content freshness.

The default rule of Pages can be overwritten by the headers configuration in edgeone.json. For the specific method, refer to the document edgeone.json - headers.


Edge Cache

Pages' default settings are optimized for edge caching of static resources. These resources are cached on EdgeOne nodes after the first request, with a maximum cache time of three months. Meanwhile, edge cache is automatically invalidated after each new deployment, ensuring users always retrieve the latest content. Therefore, in most cases, you should avoid setting caching logic for static resources on EdgeOne nodes.

You can also configure edge cache time for different resources based on business needs, optimize edge cache policies, and enhance the loading speed of requested resources. For the specific configuration method, refer to the document edgeone.json - caches.
Warning:
As long as a project triggers a new deployment, the edge cache will still be automatically invalidated to ensure users can access the latest content.

ai-agent
You can ask me like
How to Get Started with EdgeOne Pages?