What is a CDN?
A CDN is a network of servers in different locations that distributes content to users. Serving suitable copies of images, stylesheets and videos from nearby locations can reduce latency and origin-server load.
Caches and the origin server
When a file is in an edge location's cache, the request can be served directly. If the copy is missing or expired, the origin is consulted. Initial and subsequent requests can therefore have different response times. A cache key determines which requests share content; URLs, query parameters and selected headers can contribute. Personal account information must not accidentally enter a shared cache. A CDN does not replace the application's origin or database. A nearby distribution point also does not guarantee that every operation becomes faster: an application may still wait for a slow data source.
Correct use and measurement
Content-dependent versioned file URLs help prevent old files from appearing after a release. Situations requiring cache purges should be planned separately. Performance analysis should track first-response time, cache-hit ratio and origin-request volume together. For example, a product photograph can be retained longer than frequently changing stock information. Security and traffic-management capabilities vary by provider; using a CDN does not automatically fix application vulnerabilities. Monitoring and recovery arrangements should address outages, cost and incorrect caching.