Using data to specify edge dictionaries
Compute@Edge fiddles support specifying data to expose to your application as edge dictionaries. The data provided in the fiddle settings can be read in the same way as any other edge dictionary, via the dedicated interfaces in our Compute SDKs:
HINT: VCL fiddles do not yet support populating dictionaries separately to writing the edge code. However, while in Compute@Edge, dictionary lookups trigger a platform behavior at runtime, in VCL services dictionaries are rendered into the VCL source code as tables at compile time. As a result, you can effectively simulate an edge dictionary in a VCL fiddle by using a table
declaration.
Populating dictionary data
Click the 'Data' option under the request configuration to open the data editor.
Type your data in YAML format, under a top level dictionaries:
key. Keys under the top level dictionaries
key are the names of dictionaries, and within each dictionary, specify key-value pairs to populate the dictionary items.
dictionaries: config: rate_limiting: "on" banned_geos: "de:ru:au:jp" redirects: /demos: "/content/sections/d952gab58gf4wdv"
Currently the only valid top-level key within the data field is dictionaries
.
Querying dictionaries from edge code
Compute@Edge offers a dictionary interface in all supported SDKs. Code examples of dictionary lookups are included on our language specific overviews. See choosing a language in the Compute@Edge onboarding guide.