5centsCDN - Edge Rules (1.0.0)

Download OpenAPI specification:Download

Contact Support:
Email: [email protected]

Http Push Zone

Create Rule

Authorizations:
apikeyAuth
path Parameters
zoneid
required
integer
Example: 1111
header Parameters
Content-Type
string
Example: application/json
Accept
string
Example: application/json
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }

Update Behavior

Authorizations:
apikeyAuth
path Parameters
zoneid
required
integer
Example: 4468
behaviorid
required
integer
Example: 5055
header Parameters
Content-Type
string
Example: application/json
Accept
string
Example: application/json
Request Body schema: application/json
object
object
  • Configuration for edge caching settings.
    • Determines how long content is cached at the edge.
    • Examples: '3600s', '345600s'.
enabled
boolean
  • Indicates whether edge caching is enabled.
    • If 'true', content is cached at the edge.
    • Examples: true, false.
control
string
  • Specifies the control type for caching.
    • Determines how caching is handled.
    • Example: 'value'.
default
string
  • Default cache duration.
    • Time is represented in seconds.
    • Examples: '345600s', '3600s'.
object
  • Custom cache settings.
    • Can override the default cache duration.
value
string
  • Current active cache duration.
    • Defines how long content remains cached.
    • Examples: '3600s', '7200s'.
object
  • Configuration for midgress caching settings.
    • Similar to edge caching but applies at a different layer.
    • Examples: '3600s', '345600s'.
enabled
boolean
  • Indicates whether midgress caching is enabled.
    • If 'true', content is cached in midgress.
    • Examples: true, false.
control
string
  • Specifies the control type for caching.
    • Example: 'value'.
default
string
  • Default cache duration.
    • Examples: '345600s', '3600s'.
object
  • Custom cache settings.
    • Can override the default cache duration.
value
string
  • Current active cache duration.
    • Defines how long content remains cached.
    • Examples: '3600s', '7200s'.
object
  • Controls access to the service based on the user's country.
    • Defines rules for allowing or blocking requests from specific countries.
enabled
boolean
  • Indicates whether country-based access control is active.
    • true: The feature is enabled.
    • false: The feature is disabled.
policy_type
string
  • Defines the access policy type.
    • allow: Only requests from whitelisted countries are allowed.
    • deny: Requests from blacklisted countries are blocked.
ip_whitelists
string
  • A list of IP addresses or ranges that bypass country-based access restrictions.
    • Typically used for administrative or internal access.
object
  • Manages access control based on IP addresses.
    • Determines which IPs are allowed or denied access.
enabled
boolean
  • Indicates whether IP-based access control is active.
    • true: The feature is enabled.
    • false: The feature is disabled.
policy_type
string
  • Defines the access policy type.
    • allow: Only requests from whitelisted IPs are allowed.
    • deny: Requests from blacklisted IPs are blocked.
excepted_values
string
  • Specifies an IP or range of IPs that are exempt from the access policy.
    • Useful for allowing specific clients while blocking others.
ip_whitelists
string
  • A list of IP addresses or ranges that are allowed through even if the policy type is deny.
    • Typically used for internal or trusted sources.
object
  • Controls access based on the User-Agent string of incoming requests.
    • Can be used to allow or deny specific browsers, bots, or applications.
enabled
boolean
  • Indicates whether User-Agent-based access control is active.
    • true: The feature is enabled.
    • false: The feature is disabled.
policy_type
string
  • Defines the access policy type.
    • allow: Only requests from whitelisted User-Agents are permitted.
    • deny: Requests from blacklisted User-Agents are blocked.
excepted_values
string
  • Specifies a User-Agent string that is exempt from the policy.
    • Useful for allowing certain bots while blocking others.
ips
string
  • A list of IPs associated with User-Agents that should be allowed or denied.
    • Can be used to further restrict access based on both User-Agent and IP.
object
  • Configures how content is served to clients, including content disposition settings.
    • Can determine if content is displayed inline or downloaded as an attachment.
enabled
boolean
  • Indicates whether the disposition setting is active.
    • true: The feature is enabled.
    • false: The feature is disabled.
value
integer
  • Defines the disposition value, which affects how content is presented.
    • 0: Default behavior (usually inline display).
    • Other values may indicate different handling behaviors.
object
  • Enables or disables GZIP compression to reduce file size and improve load times.
    • Helps optimize website performance by compressing text-based resources.
enabled
boolean
  • Determines whether GZIP compression is active.
    • true: Compression is enabled.
    • false: Compression is disabled.
object
  • Specifies whether to fetch already compressed content from the origin.
    • This setting can improve efficiency by avoiding redundant compression.
enabled
boolean
  • Indicates whether the feature is enabled.
    • true: The server will request compressed content from the origin.
    • false: The server will request uncompressed content.
object
  • Allows rewriting of response bodies before sending them to the client.
    • This can be useful for modifying content dynamically.
enabled
boolean
  • Determines if response body rewriting is enabled.
    • true: Response bodies can be modified.
    • false: No rewriting will occur.
body
string
  • The new body content to replace the original response body.
    • Can be used to inject or modify content dynamically.
object
  • Enables HTTP Strict Transport Security (HSTS) to enforce secure connections.
    • Helps prevent protocol downgrade attacks and cookie hijacking.
enabled
boolean
  • Indicates if HSTS is enabled.
    • true: Forces HTTPS connections.
    • false: Allows both HTTP and HTTPS connections.
referrerPolicy
string
  • Specifies how referrer information is shared when navigating from the site.
    • no-referrer: No referrer information is sent.
    • strict-origin: Only the origin is sent over secure connections.
object
  • Configures automatic redirection of requests from one host to another.
    • Useful for enforcing canonical domains or migrating to new domains.
enabled
boolean
  • Indicates if host-based redirection is active.
    • true: Requests to the old host are redirected.
    • false: No redirection occurs.
object
  • Controls the supported versions of TLS for secure connections.
    • Enabling specific TLS versions can enhance security and compatibility.
enabled
boolean
  • Specifies whether TLS version restrictions are enforced.
    • true: Only allowed TLS versions are accepted.
    • false: All TLS versions are permitted.
object
  • Determines how long web content is cached in users' browsers.
    • Helps optimize performance by reducing redundant requests.
enabled
boolean
  • Indicates if browser caching is active.
    • true: The cache settings are enforced.
    • false: Browser caching is disabled.
control
string
  • Specifies how cache expiration is controlled.
    • value: Uses a custom cache duration.
    • default: Uses the default expiration time set by the server.
value
string
  • Defines the browser cache duration.
    • custom: Uses a manually specified duration.
    • default: Uses system-defined expiration time.
object
  • Holds custom browser caching settings, including cache duration.
    • Can be used to fine-tune caching policies.
object
  • Controls whether HTTP requests are automatically redirected to HTTPS.
    • Helps enforce secure connections for improved security and SEO.
    • Example values: true (redirects all HTTP requests to HTTPS), false (allows both HTTP and HTTPS).
enabled
boolean
  • Indicates if HTTP-to-HTTPS redirection is enabled. - true: Redirects HTTP traffic to HTTPS. - false: Leaves HTTP traffic as-is.
object
  • Defines access control rules based on the referrer header.
    • Useful for restricting content access to specific sources.
    • Example values: { "policy_type": "allow", "excepted_values": "example.com" }, { "policy_type": "deny", "excepted_values": "malicious-site.com" }.
enabled
boolean
  • Determines if the referrer ACL is active. - true: Enforces referrer-based restrictions. - false: Disables referrer checks.
policy_type
string
  • Specifies whether the rule allows or denies requests. - allow: Only specified referrers can access the content. - deny: Blocks specified referrers from accessing the content.
excepted_values
string
  • Defines exceptions to the referrer policy. - If policy_type is allow, these referrers are permitted. - If policy_type is deny, these referrers are blocked. - Example values: "example.com, trusted-site.org", "malicious-site.com".
ip_whitelists
string
  • Lists IP addresses that are always allowed to access content, regardless of referrer restrictions. - Supports multiple IPs separated by commas. - Example values: "192.168.1.1, 203.0.113.5", "" (empty, meaning no whitelisted IPs).
object
  • Configures access control using secure keys.
    • Ensures that only authorized requests with valid keys can access resources.
    • Example values: { "policy_type": 1, "key": "secureToken123", "timeout": 3600 }.
enabled
boolean
  • Specifies whether secure key-based access control is active. - true: Requires a valid key for access. - false: Disables secure key checks.
policy_type
integer
  • Defines the type of policy applied for secure key authentication. - 0: No policy enforcement. - 1: Requires key validation for access.
key
string
  • The secure key used for authentication. - Must be provided by clients requesting access. - Example values: "secureToken123", "mySecretKey456".
timeout
integer
  • Duration (in seconds) before the secure key expires. - Ensures temporary access control for security. - Example values: 3600 (1 hour), 86400 (24 hours).
session
integer
  • Indicates whether secure keys are session-based. - 0: No session enforcement. - 1: Requires session validation with the key.
ip_whitelists
string
  • Lists IP addresses that are always allowed to bypass secure key validation. - Supports multiple IPs separated by commas. - Example values: "192.168.1.1, 203.0.113.5", "" (empty, meaning no whitelisted IPs).
object
enabled
boolean
  • Indicates whether the stale rules are enabled.
    • A flag to toggle the stale behavior.
    • Possible values: true or false.
value
Array of strings
  • A list of error states considered as stale.
    • These are conditions under which the system considers the state as outdated or needing a refresh.
    • Example values: error, timeout, http_500.
object
enabled
boolean
  • Indicates whether forced return behavior is enabled.
    • A flag to determine if the system should force return a response under certain conditions.
    • Possible values: true or false.
code
string
  • The HTTP status code to return when the forced return is enabled.
    • This is used when the system forces a return, such as an error code.
    • Example values: 404, 500.
body
string
  • The body of the response to return when forced return is enabled.
    • This is the message or data to return alongside the status code.
    • Example values: Page not found, Server error occurred.
object
enabled
boolean
  • Indicates whether Brotli compression is enabled.
    • This is used to compress responses to reduce bandwidth.
    • Possible values: true or false.
object
enabled
boolean
  • Indicates whether slice behavior is enabled.
    • Slicing can be used to break up large payloads into smaller chunks.
    • Possible values: true or false.
object
enabled
boolean
  • Indicates whether static headers are enabled.
    • Static headers are predefined headers sent with responses.
    • Possible values: true or false.
object
enabled
boolean
  • Indicates whether Cross-Origin Resource Sharing (CORS) is enabled.
    • This controls whether resources can be shared across different domains.
    • Possible values: true or false.
control
string
  • Specifies the CORS policy.
    • Defines who can access resources and under what conditions.
    • Example values: * (allow all), localhost (allow only localhost).
custom
string
  • Allows custom CORS configurations if enabled.
    • This could specify other restrictions or rules not covered by the default.
    • Example value: Allow origin: https://example.com.
object
enabled
boolean
  • Indicates whether bandwidth limiting is enabled.
    • This restricts the rate of data transfer to prevent overload.
    • Possible values: true or false.
limit_type
string
  • Specifies the type of bandwidth limitation.
    • Could be dynamic for fluctuating rates or static for fixed limits.
    • Example values: dynamic, static.
speed
string
  • Specifies the speed limit for bandwidth.
    • This can be the maximum allowed bandwidth in kilobytes or megabytes.
    • Example values: '500kbps', '1mbps'.
buffer
string
  • Specifies the buffer size for bandwidth limiting.
    • This controls how much data can be buffered before throttling occurs.
    • Example values: 10mb, 100mb.
object
enabled
boolean
  • Indicates whether request limiting is enabled.
    • This restricts the number of requests a client can make in a certain period.
    • Possible values: true or false.
rate
integer
  • Specifies the number of allowed requests per time period.
    • Example values: 100 for 100 requests, 500 for 500 requests.
burst
integer
  • Specifies the burst limit for requests.
    • This allows a temporary higher rate of requests, typically used in scenarios like handling sudden traffic surges.
    • Example values: 10 requests, 50 requests.
delay
integer
  • Specifies the delay between requests when the rate limit is exceeded.
    • Example values: 1000 for 1 second delay, 500 for 0.5 seconds delay.
ip_whitelists
string
  • A comma-separated list of IP addresses that are exempt from request limiting.
    • Example values: '192.168.1.1, 10.0.0.1'.

Responses

Request samples

Content type
application/json
{
  • "options": {
    }
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "message": "Zone Behavior Updated. Please wait till the rules validation & deployment completes."
}

Get Rules

Authorizations:
apikeyAuth
path Parameters
zoneid
required
integer
Example: 4468
header Parameters
Accept
string
Example: application/json

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "rules": [
    ],
  • "behaviors": [
    ]
}

Http Pull Zone

Delete Rules

Authorizations:
apikeyAuth
path Parameters
zoneid
required
integer
Example: 4468
ruleid
required
integer
Example: 5055
header Parameters
Content-Type
string
Example: application/json
Accept
string
Example: application/json

Responses

Response samples

Content type
application/json
{ }

Validate

Validate Rule

Authorizations:
apikeyAuth
header Parameters
Content-Type
string
Example: application/json
Accept
string
Example: application/json
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }

Validate Rewrite

Authorizations:
apikeyAuth
header Parameters
Content-Type
string
Example: application/json
Accept
string
Example: application/json
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }