VergeCloud Page Rules
Page Rules allow you to customize and optimize your domain’s behavior within VergeCloud’s CDN. By leveraging Page Rules, you can enhance performance, security, and resource management for specific URLs, creating a tailored experience for your website’s visitors.
Core Concepts Glossary
- Cache: Temporarily stores data to reduce load times and server strain.
- Page Rule: A customizable set of conditions and actions applied to specific URLs.
- Redirect: Automatically guide users from one URL to another while maintaining SEO integrity.
- Timeout: The maximum time allowed for a request or connection to complete.
- Headers: Metadata sent with HTTP requests and responses to control browser or server behavior.
How Page Rule Priorities Work
Page Rules are executed based on their priority order, with rules at the top of the list taking precedence over those below. Only the first matching rule is applied to a request. For effective rule management:
- Ensure high-priority rules are placed at the top of the list.
- Combine settings into a single rule whenever possible to avoid conflicts.
- Use specific URL patterns to precisely target the intended pages.
Example: If you have a rule to cache https://example.com/images/*
and another to disable caching for https://example.com/images/logo.png
, the latter should be placed higher in the list to take priority.
Features
VergeCloud Page Rules offer a wide range of features to optimize and customize your domain. Below is a detailed guide to each feature.
Cache Settings
Description: Control how VergeCloud caches content for your domain. Cache settings include device-specific caching and origin cache control.
- URL Pattern: Define the URL to apply the rule (e.g.,
https://example.com/images/*
).
- Cache TTL: Set the cache duration (in seconds).
- Device Type Cache: Enable caching based on device type (e.g., mobile, desktop).
Steps to Configure:
- Navigate to the Page Rules section in your VergeCloud panel.
- Click Create Page Rule and enter the URL pattern.
- Set the Cache TTL and enable Device Type Cache if required.
- Save the rule to apply the changes.
Redirect
Description: Set up HTTP redirects (e.g., 301, 302) to guide users from one URL to another.
- URL Pattern: Define the URL for redirection (e.g.,
https://example.com/old-page
).
- Redirect Target: Specify the destination URL.
- Redirect Type: Choose between 301 (permanent) or 302 (temporary).
Steps to Configure:
- Go to the Page Rules section in VergeCloud.
- Select Redirect as the action for your rule.
- Enter the URL Pattern, Redirect Target, and Redirect Type.
- Save the rule.
Browser Cache
Description: Control how long browsers cache static content to improve performance.
- URL Pattern: Specify the URL (e.g.,
https://example.com/assets/*
).
- Browser Cache TTL: Set the duration (in seconds) for browser caching.
Steps to Configure:
- Open the Page Rules section in VergeCloud.
- Add a new rule and select Browser Cache as the action.
- Set the Browser Cache TTL.
- Save your changes.
Origin Cache Control
Description: Honor the cache settings defined by your origin server using the Cache-Control
and Expires
headers.
- URL Pattern: Define the URL scope for this rule.
Steps to Configure:
- Navigate to the Page Rules section.
- Create a rule and select Origin Cache Control.
- Enter the URL Pattern.
- Save the rule.
Timeout Settings
Description: Customize the timeout settings for connection, read, and write operations between VergeCloud’s edge servers and your origin.
- Connection Timeout: Maximum time (in seconds) to establish a connection.
- Read Timeout: Time to wait for a response from the origin server.
- Write Timeout: Time to wait for the origin server to acknowledge data sent.
Steps to Configure:
- Access Page Rules in VergeCloud.
- Create a rule and select Timeout Settings.
- Enter values for Connection Timeout, Read Timeout, and Write Timeout.
- Save the rule.
Send Traffic to Load Balancer
Description: Direct traffic for specific URLs to a configured load balancer for high availability and performance optimization.
- URL Pattern: Specify the URL to direct traffic (e.g.,
https://example.com/api/*
).
- Load Balancer: Select the configured load balancer to handle traffic.
Steps to Configure:
- Go to Page Rules in VergeCloud.
- Create a rule and select Send Traffic to Load Balancer.
- Enter the URL pattern and choose the load balancer.
- Save the rule.
Description: Override response headers sent by the origin server with VergeCloud-specific settings.
- URL Pattern: Define the URL scope for this rule.
Steps to Configure:
- Navigate to Page Rules in VergeCloud.
- Create a rule and select Ignore User Response Header.
- Enter the URL Pattern.
- Save the rule.
Description: Define a custom host header to send to your origin server for specific URLs.
- URL Pattern: Specify the URL scope.
- Host Header: Enter the custom host header value.
Steps to Configure:
- Access the Page Rules section.
- Create a rule and select Custom Host Header.
- Enter the URL Pattern and the custom host header value.
- Save the rule.
Cache by Device Type
Description: Cache by Device Type creates separate caching rules for desktop, tablet, and mobile devices, ensuring content delivery is optimized for each device.
- URL Pattern: Specify the URL scope (e.g.,
https://example.com/*
).
Steps to Configure:
- Go to the Page Rules section in VergeCloud.
- Click Create Page Rule and enter the URL pattern.
- Save the rule to apply changes.
Secure Link
Description: Secure Link restricts content access using token-based authentication, ensuring only authorized users can view protected resources.
- URL Pattern: Define the URL scope (e.g.,
https://example.com/secure/*
).
- Token Validation Endpoint: Specify the endpoint to validate authentication tokens.
- Expiration Time: Set the token validity duration.
Steps to Configure:
- Navigate to the Page Rules section in VergeCloud.
- Create a new rule and enter the URL Pattern.
- Enable Secure Link and set the validation endpoint and expiration time.
- Save the rule.
Web Boost
Description: Web Boost enhances website performance by optimizing static files, such as CSS, JavaScript, and images, on the fly.
- URL Pattern: Specify the URLs for optimization (e.g.,
https://example.com/*
).
- Optimization Level: Select the level of optimization (e.g., basic, advanced).
Steps to Configure:
- Go to the Page Rules section in VergeCloud.
- Click Create Page Rule and enter the URL Pattern.
- Select Web Boost and configure the optimization level.
- Save the rule.
Image Resize
Description: Dynamically resize images based on user-defined dimensions and resolutions to enhance load times and improve compatibility across devices.
- URL Pattern: Define the scope for resizing images (e.g.,
https://example.com/images/*
).
- Width/Height: Set the desired dimensions of images.
- Resolution: Select the resolution (e.g., 1x, 2x for retina displays).
Steps to Configure:
- Navigate to the Page Rules section in VergeCloud.
- Click Create Page Rule and specify the URL Pattern.
- Select Image Resize and configure the dimensions and resolution.
- Save the rule.
Description: Add or modify HTTP headers sent to the origin server for specific requests, ensuring proper behavior and customization for each rule.
- URL Pattern: Define the scope of the rule (e.g.,
https://example.com/api/*
).
- Headers: Add custom headers as key-value pairs.
Steps to Configure:
- Open the Page Rules section in VergeCloud.
- Create a new rule and enter the URL Pattern.
- Select Origin Request Headers and add headers as key-value pairs.
- Save the rule.
Considerations