Expansion variables allow for dynamic rules to be made without needing new rules for every possible permutation of a request or response. Use expansion variables for advanced fine-tuning of the delivery of your content over the StackPath network.
Available Variables:
General Expansion Variables
General Expansion Variables | |
%server.ip% | The Server IP |
%server.fqdn% | The Server Host Name |
%server.name% | The Server Name |
%server.pop% | The Server Pop |
%server.region% | The Server Region |
%server.platform% | The Server Platform Name |
%server.epoch% | The Server Time |
%client.ip% | The Client IP |
%client.request.protocol% | The protocol of the request (HTTP/HTTPS) |
%client.request.host% | hostname in the Host header of the request |
%client.request.fullurl% | Full URL of request (including protocol and hostname) |
%client.request.fullfilepath% | Full File Path from request (not including the query string) |
%client.request.params% | Query Parameters from request (When using with an EdgeRule, include a leading '?') |
%client.request.pathonly% | Only Path (without filename) from request |
%client.request.filename% | Only filename from request |
%client.geoip.areaCode% | The telephone area code |
%client.geoip.city% | The city or town name |
%client.geoip.continentCode% | The two-character code for the continent |
%client.geoip.countryCode% | The two-character ISO-3166-1 country code |
%client.geoip.countryCode3% | The three-character country code |
%client.geoip.countryName% | The country name |
%client.geoip.dmaCode% | Designated Market Area code |
%client.geoip.latitude% | The latitude |
%client.geoip.longitude% | The longitude |
%client.geoip.postalCode% | The postal code |
%client.geoip.regionCode% | A two-character ISO-3166-2 or FIPS 1-=4 code for state/region |
%client.geoip.regionName% | The region name |
%client.geoip.timeZone% | The time zone is generated from IANA time zone database (e.g., America/New_York) |
%query.separator% | The query separator character |
%function.random(min, max)% | Random Number Generator |
Request Receipt Expansion Variables
Request Receipt Expansion Variables | |
%delivery.firstByteDuration% | Time duration of first byte |
%delivery.contentTransferDuration% | Duration in milliseconds of the download. Ex: 57 |
%delivery.bytesFromCache% | The Bytes from the cache for the delivery |
%delivery.contentBytesServed% | Total Content Bytes served |
%delivery.sendResult% | success | abort, where success means the CDN successfully delivered a response to the client, regardless of the HTTP status code. |
%delivery.totalBytesServed% | Total bytes downloaded to the client. Ex: 5140 |
%delivery.cacheHit% | Whether or not there was a cache hit |
%delivery.firstByteServed% | The Time for the first byte served |
%delivery.lastByteServed% | The Time for the last byte served |
%delivery.attemptedBytesServed% | Number of bytes that the CDN attempted to download. Ex: 5140 |
%delivery.filesize% | On-disk size of the requested asset. Ex: 125554 |
%client.request.params% | Query Parameters from request (When using with an EdgeRule, include a leading '?') |
%client.request.headers.range.value% | Value of the Range header in the client request if it exists. Ex: bytes=5000-9999 |
%client.request.host% | The hostname in the Host header of the request |
%client.request.filename% | Only filename from request |
%client.request.endTime% | Unix timestamp marking the end of the request. Ex: 1392413133 |
%client.request.method% | The client request method |
%client.request.fullUrl% | Full URL of request (including protocol and hostname) |
%client.request.protocol% | The protocol of the request (HTTP/HTTPS) |
%client.request.pathOnly% | Only Path (without filename) from request |
%client.request.fullFilePath% | Full File Path from request (not including the query string) |
%client.request.http.version% | The HTTP Version for the client request |
%client.request.startTime% | Unix timestamp marking the beginning of the request. Ex: 1392413033 |
%client.geoip.countryCode3 | The three-character country code |
%client.geoip.timeZone% | The time zone taken from IANA time zone database (eg America/New_York) |
%client.geoip.regionName% | The region name |
%client.geoip.city% | The city or town name |
%client.geoip.countryCode% | The two-character ISO-3166-1 country code |
%client.geoip.areaCode% | The telephone area code |
%client.geoip.postalCode% | The postal code |
%client.geoip.regionCode% | A two-character ISO-3166-2 or FIPS 1-=4 code for state/region |
%client.geoip.dmaCode% | The Designated Market Area code |
%client.geoip.continentCode% | The two-character code for the continent |
%client.geoip.countryName% | The country name |
%client.geoip.latitude% | The latitude |
%client.geoip.longitude% | The longitude |
%client.ip% | IP in dot-notation of the client. Ex: 10.10.5.104 |
%client.response.headers% | The response headers from the client |
%origin.request.params% | The parameters for the origin request |
%origin.request.ip% | The IP address for the origin request |
%origin.request.host% | Origin hostname and port for requests that resulted in an origin pull. Example: myorigin.com:8000 |
%origin.request.hostOnly% | The hostname for the origin request |
%origin.request.pathOnly% | Only the File path for the origin request |
%origin.request.port% | The port for the origin request |
%origin.request.filename% | The filename for the origin request |
%origin.request.fullFilePath% | The Full File Path for the origin request |
%origin.request.protocol% | The protocol of the origin request |
%origin.request.fullUrl% | The Full URL for the origin request |
%origin.response.firstByteDuration% | The first bite duration for the origin response |
If any questions arise or any assistance can be further provided, feel free to drop us a line at hi@stackpath.com or open up a chat with our 24/7 live support, we'll be happy to help you out.