Use the Cache API in edge functions to read from and write to the edge functions independent cache: use a Request carrying eo.cacheKey as the cache key. On a cache miss, pull the remote resource from the origin and write it to the cache (with a cache duration of 10 seconds). On a cache hit, return the cached content directly. You can determine whether the cache is hit by checking the x-edgefunctions-cache response header.
Note:
For read, write, and delete operations, use the same Request object that specifies eo.cacheKey. If eo.cacheKey is not carried, the write operation will be rejected and a forbidden cdn cache error will be thrown. For details, see Cache API.
To determine whether a resource is cached by an EdgeOne site, use a Request created with the target resource URL for matching. It is recommended not to carry any client request headers. For details, see the match section of Cache API.