To configure Page Rules; follow the steps outlined in Add Page Rules article.
Values you can configure when editing or adding a page rule are provided below along with explanations. While most of the policies apply to both Static and Dynamic Distributions, they have some exclusive policies that can be configured.
Page Rule Options
Path Pattern: You can differentiate cache rules depending on the directory that requested files are available in your origin. Path pattern in a page rule specifies which requests you want this set behaviors to apply to. When MerlinCDN receives a new end-user request, the requested file path is looked up under the path patterns listed in the distributions. If the requested path matches a path pattern specified for a page rule, its cache settings are applied to the request. If not, default settings will be applied.
Policy Options: You can manage policies that apply to MerlinCDN distributions. Policies are the key to differentiate some of the core settings such as cache TTL, query string and cookie forwarding, and allowed HTTP methods. The configuration options and the logic behind them are explained in detail in this section.
- Deny Connection: You may need to restrict access to some of the paths in your origin. To configure MerlinCDN to never route requests to your origin that has the restricted path pattern, add a page rule, specify the path pattern, and set Deny Connection as Yes.
- Allowed HTTP Methods: The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers. HTTP works as a request-response protocol between a client and a server. The most common HTTP methods in a cached-CDN environment are GET and HEAD. Both options will be pre-set on Add and Edit Page Rules section as they are the basis of the client-server communication. Other common HTTP methods are explained briefly here so you can configure HTTP methods that are allowed in the client requests to your MerlinCDN distribution.
- GET is used to request data from a specified resource.
- POST is used to send data to a server to create/update a resource.
- PUT is used to send data to a server to create/update a resource.
- HEAD is almost identical to GET but without the response body.
- DELETE deletes the specified resource.
- PATCH is similar to PUT method.
- OPTIONS describes the communication options for the target resource.
- Cache TTL: You can configure MerlinCDN to use Origin cache headers or not to cache files at all based on your requirement. If the aforementioned options do not comply with your requirement, specify the default duration that you want MerlinCDN to keep files in its caches before it forwards another request to your origin to determine whether the file has been updated. Detailed information about caching and origin cache headers can be found in HTTP Caching article.
- Query String Forwarding and Caching: You can configure if you need MerlinCDN to forward query strings to your origin and whether to cache content based on all parameters or on selected parameters. Detailed information about query strings can be found in Query Strings article. You can configure MerlinCDN cache behavior for query strings with the following options:
- None: Don't forward query strings to the origin. If it is set to None, MerlinCDN will not cache content based on query strings parameters.
- Forward all, cache based on all: Forward all query strings to the origin, and cache based on all parameters in the query string.
- Forward all, cache based on whitelist: Forward all query strings to the origin and cache based on whitelisted parameters in the query string. If you select this option, specify the whitelisted items in this section.
- Background Cache Update (only Dynamic): If it is enabled, the stale cache will be sent to the user while the content is being updated in the background.
- Cache Based on Selected Request Headers (only Dynamic): You can configure Merlin CDN to keep a new cache object for every value of the selected headers. Thus, there will be multiple objects for the given path.
- Hide Client User-Agent: You can configure MerlinCDN to not send client user-agent to the requests routed to the Origin server.
- Browser Cache TTL: You can configure Browser cache TTL the same as Cache TTL or specify whether you want files to stay in browser caches for a different duration than they stay in MerlinCDN caches. Detailed information about caching and origin cache headers can be found in HTTP Caching article.
- Cacheable HTTP Methods (only Dynamic): You can configure Merlin CDN to only cache requests with selected HTTP methods.
- Minimum Request Count for Cache: The minimum number of requests required to cache that object.
Please sign in to leave a comment.