Abstract


  • Stand as Content Delivery Network
  • A network of geographically dispersed cache servers used to deliver static content like images, videos, CSS, JavaScript files, etc
  • It enables the caching of HTML pages based on request paths, query strings, cookies, and request headers etc
  • The origin server returns static assets to the CDN server, which may include optional HTTP headers like Cache-Control, specifying how long the static assets are cached on the client

Improved loading time

When a user visits a website, a CDN Server closest to the user will deliver static content. By doing so, the CDN server also helps to relieve the load on the origin server.

CDN Fallback

If there is a temporary CDN outage, Client should be able to detect the problem and request resources from the origin. Thus ensuring Fault Tolerance (容错性).

Info

Dynamic content caching is a relatively new concept.

CDN Cache Expiry


  • For time-sensitive content, setting a cache expiry time is important
  • It should neither be too long nor too short. If it is too long, the content might no longer be fresh. If it is too short, it can cause repeated loading of content from origin servers to the CDN, which leads to wasted bandwidth

CDN Cache Invalidation

  • We should be able to invalidate the CDN object using APIs provided by CDN vendors
  • Or allow versioning like image.png?v=2

CDN in China


  • While using a CDN can help improve loading times, many global CDNs do not have Points of Presence within China, limiting their effectiveness. A China-specific CDN can mitigate some of these issues but often requires compliance with local laws

Local laws

Websites without an ICP license often experience slower loading speeds due to the Great Firewall of China, which adds latency to data requests. This can result in loading times exceeding 10 to 30 seconds, far beyond the user expectation of under 2 seconds.

Increased Risk of Blocking: Websites that do not comply with local regulations may face higher chances of being blocked