Movatterモバイル変換


[0]ホーム

URL:


  1. Home
  2. Reference documentation
  3. VCL reference
  4. Variables in VCL

Geolocation

Fastly provides a variety of geolocation data, allowing the originating geographical location of a request to be determined.

IMPORTANT: IP geolocation information, including data streamed by ourlog streaming service, is intended to be used only in connection with your Fastly services. Use of geolocation data for other purposes may require permission fromDigital Element, our data supplier. For more information see ouroverview of using IP-based geolocation and intelligence.

Theclient.geo. namespace contains the geolocation data we recommend for most use cases. Theclient.as. namespace offers information about the client'sAutonomous System (AS), which is often the end user's Internet Service Provider.

Legacy geolocation datasetLearn more...

IP address used for lookup

The IP address used for the geolocation lookup is automatically populated fromclient.ip by default, but may be overridden explicitly by settingclient.geo.ip_override.

Lossy formats

Geographic variables representing names are available in several formats. Note in particular the*.ascii variables are lossy. These variables have diacritics removed and are normalized to lower case spellings. These*.ascii variables are intended for ease of use as a symbolic string in code (for example, to perform some different action depending on the city name), and are generally inappropriate for presenting to users due to their simplified content.

Absent data

The data is updated periodically, as IP allocations change and various amendments are made. Some variables may be absent for the current data at any given time.

For STRING types, the special value? is used to indicate absent data. These may be normalized to VCL empty strings using theif ternary operator:

if (client.as.name=="?",client.as.name,"");

In general values of typeSTRING in VCL may benot set, but this should never occur for the Geolocation variables.


[8]ページ先頭

©2009-2025 Movatter.jp