HTTPS/HTTP Cache Sharing

Last update:2026-04-28 17:40:41

Typically, when users request the same contents using either HTTP or HTTPS protocols, the request URL only differs by the scheme, such as http://domain/index.html and https://domain/index.html. By default, CDN servers will cache multiple copies of the same file, and requests with different protocols will hit distinct cache entries, even though the file content is expected to be identical in most cases.

On CDNetworks CDN platform, you can customize whether requests that differ only by the HTTP/HTTPS protocol should be cached as the same file. Besides, you can configure whether to ignore protocol differences when purging the cache on CDN servers, thereby refreshing file resources that share the same URL (differing only by scheme).

To enhance cache hit rate of user requests on CDN servers, it is highly recommended to configure HTTPS/HTTP Cache Sharing.

How to Configure HTTPS/HTTP Cache Sharing

  1. Log in to the CDNetworks Console and select the appropriate product.
  2. Navigate to the Configuration, locate the domain you wish to configure, and click on Edit Configuration at the top or the Edit button to the right of the domain image.png.
  3. Enter the configuration modification page, find the HTTPS/HTTP Cache Sharing under Cache Optimization, and click the Add button;
  4. On the rule editing page, you can easily add the following configuration options based on your needs.
Parameter Description
Ignore Protocol When Caching The default value for this setting is No, meaning the same file URL does not ignore the HTTP/HTTPS protocol out of user requests, resulting in multiple cache entries for the same file on CDN nodes.
If you choose Yes, the CDN servers will ignore the request protocol. When a file (e.g., file A) is cached on CDN servers, requests for file A using either HTTP or HTTPS protocol will hit the same cache entry on CDN servers.
Ignore Protocol When Purging The default value is No, meaning when you submit a purge task specifying an https:// file path, only the https:// cache entry on CDN servers will be purged. If there is a http:// cache entry, requests using http:// will still hit the existing cache.
If you choose Yes, the protocol of the URL in the purging task will be ignored, and both http:// and https:// cache entries on CDN servers will be purged. Subsequent user requests, whether HTTP or HTTPS, will result in a cache MISS.
Currently, this configuration only applies to the URL Purge mode.

After you have completed setting the configurations, please click OK and then select Next to submit your settings. To minimize any potential disruptions to your production environment, we strongly recommend conducting a Pre-deploy test in a staging environment. This crucial step ensures that your configurations are accurate before they go live. Once you have verified the accuracy of the settings, click Deploy Now to implement them in the production environment. The configurations typically become effective within 3-5 minutes. For comprehensive guidance on pre-deployment testing and to verify the effectiveness of your configurations, please consult the tutorial Deploy the Configurations to Staging Environment for Validation.

Notes

If you set Ignore Protocol When Caching to Yes, Ignore Protocol When Purging can only be set to Yes by default and cannot be set to No. Otherwise, since you have configured ignore protocol when caching contents on CDN servers, user requests over either HTTP or HTTPS protocol will hit the cache, but CDN servers might cache the contents with the HTTP protocol. However, the purging task you submit uses the HTTPS protocol and if you don’t ignore protocol to purge caches, the HTTP protocol cache entry will not be purged, and user requests will still hit the old cached file (if it is within the cache validity period).

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!