Page Rules allow you to configure specific behaviors for your domain on VergeCloud’s CDN service. By adding your domain to your VergeCloud panel and enabling the cloud option, the system automatically applies default settings for all your subdomains. This means that static files will begin to cache automatically.
For example, suppose you have a website at dev.test.com and you want to disable caching for the /static/ path to observe changes in real-time. You would create a rule to disable caching specifically for this path, ensuring that updates are visible without delay.
To create effective page rules, follow this syntax: scheme://hostname/path
. For instance:
https://subdomain.test.com/somepage
Note that the request will only match the first rule that fits. All necessary settings must be included within that same rule, as rules are evaluated from top to bottom.
Use * for wildcards to match all requests that begin with a specific pattern:
dev.test.com/static/*
Brackets [ ] can be used to match specific characters. Here are some examples:
https://www.example.com/fa
and https://www.example.com/Fa
, use:
https://example.com/[fF]a/*
https://example.com/users/[0-9]*
https://example.com/[a-z]/*
Rules are case-sensitive. For uppercase letters, a separate rule must be created with A-Z included.
To configure a caching rule via API, use the following cURL command:
curl -X POST "https://api.vergecloud.com/v1/page-rules" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://dev.test.com/static/*",
"cache": {
"enabled": true,
"ttl": 3600
}
}'
To verify your Page Rules setup, follow these steps:
curl
to check the response headers and confirm caching behavior:curl -I https://dev.test.com/static/somefile.jpg
dig
to analyze DNS settings:dig dev.test.com
You can delete cached files for a specific page. To purge the cache, navigate to the Page Rules section in your VergeCloud panel and click on "Delete Cache." Note that this feature is only available for users on the Professional Plan.
To set up automatic redirection with advanced settings, refer to the Redirection Guide for detailed instructions on utilizing variables.
Modify the default timeout settings for the connection between CDN edge servers and your main server:
Note: Timeout settings are available to users on the Professional Plan. Upgrade is necessary for other plans.
To enhance your website’s content management, you may need to configure cache settings from the origin server using the Origin Cache-Control header.
The CDN requests your origin server to cache content, and the response includes caching parameters. Implementing Cache-Control settings provides detailed caching instructions to the edge servers.
To enable the cache-control feature:
Note: This feature is only available in the Enterprise Plan. Upgrade is required for other plans.