Skip to content

Our cdn solution

What is CDN?

With each visit of a web page, your web browser must download all files that the site links to. If the visitor is geographically distant from the server, this can lead to significant delay in page load.

Our CDN provides cache servers in several locations. If you use the CDN, your customers do not have to download static content from your distant web server, but the much closer cache server. Thank to that, page loads are much faster.

Main advantages of CDN

  • better loading times for visitors
  • less load on your web servers
  • partial protection from DDoS attacks


As of this time, we offer CDN in Europe, USA and globally. In Europe, we have cache servers in Prague, London, Madrid and Bucharest. For USA, we offer cache servers in New York.

Activating the service

  • When you order CDN service, you will be a given a CDN domain that you must use for linking to your static content. For example, if your website is, the domain will be
  • Your programmers must change static content links in your application to
  • Thanks to anycast technology and specially configured DNS servers, visitors will always download static content from the server that is closest to them.

List of IP addresses

At the moment, the CDN can download static content from your servers using the following IP addresses:

Or these IPv6 addresses:


The IP addresses can change in time. You can get list of current IP addresses at these URLs: IPv4, IPv6. The addresses are delimited by newlines ('\n').

Getting visitors' IP addresses

The CDN server saves visitor's original IP address in the "CDN-VSHOSTING-Real-IP" header. However, you need to configure your web server, so it trusts this header only in case the request comes from one of the CDN IP addresses. You can find their list above.

Below are example configurations:


real_ip_header CDN-VSHOSTING-Real-IP;


RPAFenable On  
RPAFproxy_ips RPAFheader CDN-VSHOSTING-Real-IP

Checking IP address in PHP:

function get_realip() {  
    $real_ip = $_SERVER[REMOTE_ADDR]  
    $cdn_ip = array("", "", "", "", "", "" "", "", "", ""); if (in_array($_SERVER[REMOTE_ADDR], $cdn_ip)) { $real_ip = $_SERVER[HTTP_CDN_VSHOSTING_REAL_IP]; } return $real_ip; }

Setting the expiration period

In order to set the expiration period, you can use "Cache-Control" or "Expires" headers. "Cache-Control" has more options.

If you want to cache content for up to 10 minutes, set "Cache-Control" as following:

"Cache-Control: public, max-age=600"

Afterwards, you can you this snippet in .htaccess:

<FilesMatch "\.png$">  
    Header set Cache-Control max-age=3600  

The example above will let CDN cache png files for maximum of 1 hour. After this time elapses, CDN will check whether the files have been modified.

Adding Cache-Control in PHP

For setting "Cache-Control", you can use the header function:

header("Cache-Control: max-age=600");

You need to call it before any content is sent, so as early in your code as possible.

GeoIP mode

Using GeoIP, you can restrict access to CDN to certain countries. GeoIP can be used as blacklist or as whitelist. After choosing a mode, you can pick countries you want to block or allow from the dropdown menu. It is possible to select multiple countries.

Remote log

You can send CDN logs to a remote server for analysis. At the time of writing, you can only use syslog. You can specify the remote server in the "Remote Log" field in the CDN administration interface. For example "syslog://" (use IP address or hostname of your server instead of By default, the logs are sent via UDP to port 514.

Automatic conversion to WebP

This feature enables converting .bmp, .png, .jpg and .jpeg files (".(?:bmp|png|jpg|jpeg)$" as regular expression) to WebP when using CDN. You can find more information about WebP image format at The CDN checks browsers for WebP support via "Accept-Encoding" header. To browsers, that do not support it, it sends the original image. After turning this feature on, you need to wait for one hour until the converted files will be available. Therefore, "Cache-Control" or "Expires" need to be set to at least one hour (3600 s). If the images in question are already cached on CDN, you need to remove those first. The conversion can be turned off by vshcdn-webp-noautconvert=1 parameter in URL, or setting VSHCDN-WEBP-NOAUTOCONVERT=1 header on the backend.

When using this function, redirects are followed internally in the CDN and the image is returned to the client with the original url, in case you need the opposite behavior please contact us via ticket with the information for which domain you wish to reconfigure the functionality.


Newly, you can remove a cached URL from CDN directly in the CDN interface. In your domains tab, you have a Cache Control button next to each domain. After clicking on it, you can either discard all cached content, or remove individual items by URL. The URL needs to be in the following format: "". If you are using a domain alias, you need to enter it as well: "". You can also use a wildcard *, but only at the end of the URL. For example, to delete all images from a directory, enter "*". You need to specify the protocol as well, so for complete removal, you need to enter both "http://" and "https://".

Access log

In the transfer history tab, you can now download access log in text format. Alternatively, you can diplay it in your browser using GoAccess.