The CDN event trigger connects Alibaba Cloud Content Delivery Network (CDN) with Function Compute, so your functions run automatically when CDN lifecycle events occur — cache refreshes, log file creation, domain management changes, and more. Write function code once; the trigger handles invocation whenever CDN detects a matching event on the domains you specify.
How it works
Alibaba Cloud CDN is a distributed network of edge nodes that caches origin server resources closer to end users, reducing latency and offloading traffic from your origin. When CDN captures a lifecycle event, it encodes the event data as a JSON string and forwards it to your function for processing.
Use cases
Track cache refresh and preload status — React to
CachedObjectsRefreshedandCachedObjectsPushedevents to get the current status of a refresh or preload operation as soon as it completes, instead of polling the status list repeatedly.Process log files as they arrive — React to
LogFileCreatedevents to run log processing pipelines immediately when CDN generates a new log file, without waiting for a scheduled batch job.Respond to domain lifecycle changes — React to
CdnDomainStartedorCdnDomainStoppedevents to trigger downstream data processing as soon as a CDN domain is enabled or disabled.
Supported events
All events are filtered by domain name. When the CDN system detects an event on a domain that matches your trigger's filter, it automatically invokes your function. All events use version 1.0.0.
| Event | When it fires | Reference |
|---|---|---|
CachedObjectsRefreshed | A cache refresh operation completes on the domain | RefreshObjectCaches |
CachedObjectsBlocked | A specified URL is blocked on a Point of Presence (POP). Note To use this event, submit a ticket to have your account added to the CDN allowlist. | — |
CachedObjectsPushed | A cache preload operation completes on the domain | PushObjectCache |
LogFileCreated | CDN generates a new log file for the domain | DescribeCdnDomainLogs |
CdnDomainStarted | A CDN domain is enabled | StartCdnDomain |
CdnDomainStopped | A CDN domain is disabled | StopCdnDomain |
CdnDomainAdded | A new CDN domain is added | AddCdnDomain |
CdnDomainDeleted | A CDN domain is deleted | DeleteCdnDomain |