How properties work
Properties are accessed through two core methods:get_property(path): Reads data from the current request contextset_property(path, value): Modifies writable properties to customize CDN behavior
request.path, response.status) and has specific access permissions based on the hook where it’s accessed.
Property access patterns
Read-only properties: Can be read but not modified. These typically represent immutable request data or CDN internal state. Read-write properties: Can be both read and modified. Use these to customize headers, adjust routing, or modify response behavior. Hook-specific availability: Some properties are only accessible in certain hooks. For example, response properties are unavailable in request hooks.Available properties
The following table lists all available properties and their access permissions. These properties can only be written to within the onRequestHeaders hook:| Property Path | Type | Access | Description |
|---|---|---|---|
request.url | String | Read-write | Original URL path before modifications |
request.host | String | Read-write | Host header value |
request.path | String | Read-write | Request URL path |
request.scheme | String | Read-only | Protocol scheme (http/https) |
request.method | String | Read-only | HTTP method (GET, POST, etc.) |
request.extension | String | Read-only | Request path extension |
request.query | String | Read-write | Query string parameters |
request.country | String | Read-only | Country Code - deciphered from IP |
request.city | String | Read-only | City name - deciphered from IP |
request.asn | String | Read-only | ASN of the network/ISP associated with the request IP |
request.geo.lat | String | Read-only | Latitude - deciphered from IP |
request.geo.long | String | Read-only | Longitude - deciphered from IP |
request.region | String | Read-only | Region - deciphered from IP |
request.continent | String | Read-only | Continent - deciphered from IP |
request.country.name | String | Read-only | Country name - deciphered from IP |
nginx.log_field1 | String | Write-only | Adds value to nginx access logs |
response.status | Integer | Read-only | HTTP status code |
nginx.log_field1
This field is write-only (onRequestHeaders). Adding a value here will ensure it is written to CDN access log, available through the Log uploader feature.
Custom properties
You can also create custom properties within hooks. This allows you to track data between hook runs. e.g. custom propertymarkdown
These custom hooks are all read-write, however they are only available from onRequestBody onwards. Anything added within onRequestHeaders will not be available, in future hooks.
Example: Response modification
Property modification best practices
Validate before setting: Always validate property values before modification to prevent errors. Use appropriate hooks: Modify request properties only in onRequestHeaders. Handle missing properties: Not all properties are available in all contexts. Use error handling when accessing optional properties.NoteProperty paths are case-sensitive. Header names follow HTTP conventions (lowercase with hyphens).