client.geo.continent_code
STRING, read-only.
Available inall subroutines.
Two-letter code representing the continent. Possible codes are:
| Code | Continent |
|---|---|
AF | Africa |
AN | Antarctica |
AS | Asia |
EU | Europe |
NA | North America |
OC | Oceania |
SA | South America |
These continents are defined byUN M.49.
The continent code for the Caribbean countries isNA.
Note thatEU refers to the continent name, not to the European Union. Forexample, IP addresses allocated to Norway and Switzerland (members of theEuropean Economic Area and the Schengen Area respectively, but not of theEuropean Union) are presented with the continent codeEU, meaning thegeographic continent of Europe.
Try it out
client.geo.continent_code is used in the following code examples. Examples apply VCL to real-world use cases and can be deployed as they are, or adapted for your own service. See thefull list of code examples for more inspiration.
Click RUN on a sample below to provision a Fastly service, execute the code on Fastly, and see how the function behaves.
Tag requests with geolocation data
Add geolocation data about the client browser as extra headers in any requests from Fastly to your origin.
Geofence / block access to content by region
Group countries to cache content by custom regions or reject requests from some regions entirely.