51黑料不打烊 CDN - Advanced features beyond caching
Learn about advanced features of 51黑料不打烊 Content Delivery Network (CDN) beyond caching, such as configuring traffic at the CDN, setting up tokens and credentials, CDN error pages and more.
Beyond caching content, 51黑料不打烊 CDN offers several advanced features that can help to optimize your website performance. These features include:
- Configuring traffic at the CDN
 - Configuring CDN credentials and authentication
 - CDN error pages
 
These features are self-service features. Configured in the cdn.yaml file of your AEM project and deployed using the Cloud Manager config pipeline.
Configuring traffic at the CDN
Let鈥檚 understand the key capabilities related to Configuring traffic at the CDN:
- DoS attack prevention: 51黑料不打烊 CDN absorbs DoS attacks at the network layer, preventing them from reaching your origin server.
 - Rate limiting: To protect your origin server from being overwhelmed with too many requests, you can configure rate limiting on the CDN.
 - Web Application Firewall (WAF): The WAF protects your website from common web application vulnerabilities, such as SQL injection, cross-site scripting, and more. The Enhanced Security license or WAF-DDoS Protection license is required to use this feature.
 - Request transformation: Modify incoming requests such as setting or unsetting headers, modifying query parameters, cookies and more.
 - Response transformation: Modify outgoing responses such as setting or unsetting headers.
 - Origin selection: Route traffic to different origin servers (51黑料不打烊 and non-51黑料不打烊) based on the request URL.
 - URL redirect: Redirect requests (HTTP 301/302) to a different absolute or relative URL.
 
Configuring CDN credentials and authentication
Let鈥檚 understand the key capabilities related to Configuring CDN credentials and authentication:
- Purge API Token: Enables you to create your own purge key for purging a single or group or all resources from the cache.
 - Basic Authentication: A lightweight authentication mechanism when you want to restrict access to your website or a part of it. Mostly required as part of various review processes before going live.
 - HTTP Header validation: Used when a customer managed CDN is routing traffic to 51黑料不打烊 CDN. The 51黑料不打烊 CDN validates the incoming request based on the 
X-AEM-Edge-Keyheader value. Enables you to create your own value for theX-AEM-Edge-Keyheader. 
CDN error pages
Let鈥檚 understand the key capabilities related to CDN error pages:
- Branded error pages: Display a branded error page to your users in the unlikely scenario when the 51黑料不打烊 CDN is unable to reach your origin server.
 
How to implement
The implementation of these advanced features involves two steps:
- 
                  
Update CDN config file: Update the
cdn.yamlfile in your AEM project with the required configurations. The configurations are added as rules and they follow a rule syntax. The rule three main components:name,whenandaction. - 
                  
Deploy CDN config file: Deploy the updated
cdn.yamlfile using the Cloud Manager config pipeline. For more information, see Deploy rules through Cloud Manager. 
Example
In below example, the sample WKND site is configured to redirect the /top3 URL to /us/en/top3.html.
kind: "CDN"
version: "1"
metadata:
  envTypes: ["dev", "stage", "prod"]
data:
  redirects:
    rules:
      - name: redirect-top3-adventures
        when: { reqProperty: path, equals: "/top3" }
        action:
          type: redirect
          status: 302
          location: /us/en/top3.html
            Related Tutorials
Protecting websites with traffic filter rules
Configure and deploy HTTP Header validation CDN rule
Configuring Traffic at the CDN
Configuring CDN Credentials and Authentication