The Content Delivery Network has to deliver content to users in the shortest time and highest speed. CDNs usually use these two methods to deliver contents to the end-user and store resources on their edge servers:
- Pull method,
- Push method.
In this method, there is no obligation to cache the website resources on the edge servers. The first request from a user to a CDN edge server for receiving a resource causes the edge server to request it from the central server that hosts the website. When the edge server receives the response, it transfers the resource to the user and caches it as well. The other requests are responded to via the resources cached on the edge server.
Be noted that (in such a situation) website resources are cached on all of the CDN edge servers across the world only if different users, who are living in various geographical points, send requests for accessing these resources to the edge servers.
The resources cached on the CDN edge server maintain on the server until their timespan expires. When a resource expires, the first user’s request makes the edge server transfer a request for the resource to the central server that hosts the website and cache it before responding to the user.
The benefit of this method is that it is easy to implement. The reason is that the entire contents are cached on the CDN PoP-sites under your primary domain name. Therefore, there is no need to enter the domain name or additional settings into relevant plugins. Some companies, such as Cloudflare and KeyCDN, support this method.
ArvanCloud also uses the Pull method in its CDN product.
In the Push method, a copy of the website static resources is cached on all the CDN edge servers across the globe. Hence, when an edge server receives a request to access one of the resources, it uses the cached resources to retrieve the user request.
In such a situation, we can consider the edge servers as the supporting servers of the central server that hosts the website. In this method, the website manager should manually transfer the required content to the edge servers for being cached.
Usually, CDNs that support this method introduce some servers as the Push servers. The website manager places the resources on a Push server, and the edge servers receive the resources from that one. Be noted that (in this method), while setting the plugins, you must enter the CDN domain name.
The benefit of using this method is that the end-user does not wait for copying the content from the central server to the CDN edge server and then downloading it via the browser. (These events, of course, happen just in several milliseconds). However, this method obliged the website manager to transfer the files to the Push servers continually and make sure of their being updated. In other words, implementing this method is challenging. Some companies, such as Amazon Cloudfront and MaxCDN, use this method.