Global Static Files (2)

In addition to the usage mentioned in Global Static Files (1), Edge also provides a third and more general usage.

Sometimes, we need to serve static resources on Edge and let clients in different regions access the static resources in the corresponding regions to improve the access efficiency of static resources.

Create Static Resource

  • Upload file:

Size limit: 10 MB.

  • Create directory:

Edit Static Resource

You able to re-upload the file content, but rename the file is not supported yet.

Delete Static Resource

Usage of Static Resources

  • Upload resource: test/abc.png

  • Add Page Rule

This rule will taken 1-2 segments (separated by /, e.g., if the URI is /any/test/abc.png, then test and abc.png will be obtained to form a new path /test/abc.png) from the URI and used as the path to find the corresponding static file. If the start index is 0, it means start from the first segment. If the end index is 0, it means to the last segment.

  • Send Request
GET /any/test/abc.png

Usage of Static Resources: Using static resources in Edgelang

true =>
    send-static-file("/test/abc.png");