Edge Developer Platform
  • Pages
    • Product Introduction
    • Quick Start
      • Importing a Git Repository
      • Starting From a Template
      • Direct Upload
    • Framework Guide
    • Project Guide
      • Project Management
      • edgeone.json
      • Configuring Cache
      • Error Codes
    • Build Guide
    • Deployment Guide
      • Overview
      • Create Deploys
      • Manage Deploys
      • Deploy Button
      • Use Github Actions
    • Domain Management
      • Overview
      • Custom Domain Name
      • Configuring an HTTPS Certificate
      • How to Configure a DNS CNAME Record
    • Pages Functions
    • KV Storage
    • Edge AI
    • API Token
    • EdgeOne CLI
    • Pages MCP
    • Integration Guide
      • 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
      • Use the Deepseek-R1 model to quickly build a conversational AI site
      • Building an Ecommerce Platform with WordPress + WooCommerce and GatsbyJS
      • 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
Unlock 1 Year of EdgeOne + 1TB CDN: Join Our Developer Journey
Get Started Now !

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.

You can also override Pages' default rules through the headers configuration in edgeone.json. For specific configuration methods, 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 customize edge cache time for different resources based on business needs, optimize edge caching strategies for different resources, and enhance the loading speed of requested resources. For specific configuration methods, 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.