Try CDNetworks
For Free
Most of our products have a 14 day free trial. No credit card needed.
CDNetworks’ redirect optimization feature plays a key role in improving user access speed, optimizing resource management, and enhancing user experience. Through various optimization measures, CDNetworks effectively addresses common issues such as redirect latency, error page handling, and duplicate resource requests, thereby significantly improving network performance.
For many business requests, there are situations where the origin server returns a 301/302 response, but the origin server does not want the 301/302 to be directly passed through to the end user. To address this, the ‘Redirect Optimization’ feature can be used. If the origin server returns an HTTP status code of 301/302, CDNetworks CDN PoPs can request the file based on the target URL specified in the Location header of the HTTP 301/302 response. The CDN then returns the file to the user and caches it on the CDN PoP. This process hides the redirection from the user, eliminating the need for the user to make an additional request to the URL after the 301/302, thus speeding up user access.
When a user initiates a request and the origin server encounters an issue, directly returning a 4xx or 5xx error status to the front end can result in a very poor user experience. To address this issue, the ‘Error Page Redirection’ feature can be used. When a CDN PoP makes a request to the origin server and receives a 4xx or 5xx error status code, the CDNetworks edge PoP will return a response with an HTTP status code of 302 to the client, with the Location header indicating the redirect page for the error. When the user’s browser receives this response, it will make a request to the URL specified in the Location header, thereby providing a more user-friendly error page and preserving the user experience.
A typical HTML page contains resources that need to be loaded separately (such as images, text files, CSS, JavaScript, etc.). When a user requests this page, these resources are loaded along with the page and cached locally. If the user refreshes the page after the max-age time has expired, new HTTP requests for these static resources will be sent. If the files have not expired, the server returns a 304 response, allowing the cached version to be used directly, but this still incurs some response time overhead. If the files have expired, the server returns the new resources.
To address this, the ‘Embedded URL Rewriting’ feature can be used to prevent the client from making requests for unexpired files, saving time between sending requests and receiving responses, thus reducing the page load time for the client. The specific method involves rewriting the embedded URLs in the HTML page to include specific information about the resources (referred to as a PV value), and modifying the HTTP response headers to allow resources to be cached locally for up to one year. When the server updates the resources, the URLs of the resources change (reflected by a change in the PV value), and the outdated cached resources will no longer be used.
Usage method: Inform the CDNetworks customer service of the redirect optimization requirements and provide an example of the target URL. CDNetworks will complete and test this configuration within one day.
Note:
Usage: You need to inform CDNetworks customer service of your specific requirements, providing the error status code and the URL to redirect to (i.e., which page to redirect to).
Note:
The specific approach is to rewrite the embedded URLs in the HTML page to include specific information about the resources (referred to as the PV value). When the server modifies the resource, the resource’s URL will also change (reflected by the change in the PV value), and the old resources in the cache will not be used. At the same time, the HTTP response headers will be rewritten so that the resource can be cached locally by the user for one year. For example:
HTML tag: <img src=”images/logo.gif”/>
HTTP header: Cache-Control;public,max-age=300
Will be modified to:
HTML tag: <img src=”images/logo.gif;pv=12345678″/>
HTTP header: Cache-Control;public,max-age=31536000
The CDN PoP will continue to use the original max-age value of the resource (e.g., 300 seconds in the previous example) to determine whether the resource has expired. If the resource changes, the corresponding PV value will also be updated, and a new URL will be provided to the accessing user. When the resource has not changed, users will continue to access the local cache of the CDN, avoiding unnecessary resource requests and thus improving page loading speed.
Note:
CDNetworks CDN redirection provides several important benefits:
CDNetworks is one of the global leaders in Content Delivery Network (CDN) technology, offering fully integrated Edge Computing and Cloud Security solutions. With an expansive network of over 2,800 Points of Presence (PoPs) and CDN capabilities exceeding 200 Tbps, we ensure your content is delivered with exceptional speed and reliability. Through strategic partnerships with ISPs worldwide and our comprehensive optimization features, we help businesses enhance their user experience while reducing server load and operational costs.
Introducing Edge Application — CDNetworks’ serverless edge computing solution. Learn how it works, its key benefits, and real-world use cases.
CDNetworks successfully mitigated a massive-scale DDoS attack targeting a browser game platform with a large user base in Southeast Asia.