Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Managing CDN Functions

Updated on 2024-11-12 GMT+08:00

Precautions

The priorities for function configurations in CDN and FunctionGraph vary in different stages. The details are as follows:

  • Client request received: The function is executed in FunctionGraph first and then configured by CDN, so it is the CDN configuration that takes effect at last.
  • Before origin pull: The function is configured by CDN first and then executed in FunctionGraph, so it is the FunctionGraph configuration that takes effect at last.

Procedure

  1. Log in to the CDN console. In the navigation pane, choose Domains. In the domain name list, click the domain name for which you want to configure a function. The details page is displayed.

    Figure 1 Domain name management

  2. Select Functions. If you do not have permission to create an agency, see Creating an Agency. If you have created an agency, click Edit and then click Add Stage.

    Figure 2 Adding a stage

  3. Configure the function stage and rule.

    • Select Client request received for Stage. For details, see Table 1.
    • Set Content Type to All files, Function to programmable-cdn, Version to V1, and Priority to 1. For details, see. Table 2. A maximum of 40 rules can be added.
    Figure 3 Configuring function stage and rule
    Table 1 Function stage description

    Stage

    Description

    Client request received

    Functions are executed between the time when a client initiates a request and the time when a CDN node receives the request, for example, URL rewriting.

    Before origin pull

    Functions are executed before a CDN node receives a request that is not cached and retrieves the requested resource, for example, rewriting the retrieval URL.

    Table 2 Rule parameters

    Parameter

    Description

    Content Type

    All files: The rule takes effect for all files.

    File type: Files with the specified types comply with the current rule.

    Directory: Files in the specified directory comply with the current rule.

    Full path: Files in the full path comply with the current rule.

    Content

    If Content Type is set to All files, you do not need to set this parameter.

    If Content Type is set to File type:

    • Enter a period (.) as the first character.
    • Use commas (,) to separate multiple file types, for example, .jpg,.zip,.exe.
    • Enter up to 20 file types.

    If Content Type is set to Directory:

    • Enter a directory starting with a slash (/).
    • Use commas (,) to separate multiple directory paths, for example, /test/folder01,/test/folder02.
    • Enter up to 20 directory paths.

    If Content Type is set to Full path:

    • Enter a path start with a slash (/), for example, /test/index.html or /test/*.jpg.
    • A file in the specified directory or file with the wildcard * can be matched.

    Function

    Select a function created in FunctionGraph. If no function is available, click Create Function to create one.

    Function version

    Select the related function version.

    Priority

    If there are multiple rules in a function stage, the priority determines which rule is executed first.

    • Enter an integer ranging from 1 to 100. A greater number indicates a higher priority.
    • The priority must be unique. Two rules cannot have the same priority.

  4. Click Save.

    The deployment takes about 5 minutes. After it is complete, the function configuration will be deployed on the edge node. Then you can access CDN to trigger functions and run scripts on CDN edge nodes.
    Figure 4 Saving configurations

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback