Cache and CDN

Web Cache:

  • To reduce latency — Because the request is satisfied from the cache (which is closer to the client) instead of the origin server, it takes less time for it to get the representation and display it. This makes the Web seem more responsive.
  • To reduce network traffic — Because representations are reused, it reduces the amount of bandwidth used by a client. This saves money if the client is paying for traffic, and keeps their bandwidth requirements lower and more manageable.

Web Cache的种类:

  1. Browser Caches
    usecase: like hit “back” button. Usually once a session

  2. Proxy Caches
    proxy caches aren’t part of the client or the origin server
    a. browser proxy setting
    b. interception
    Proxy caches are a type of shared cache; rather than just having one person using them, they usually have a large number of users
    Cache and CDN
    Cache and CDN

  3. Gateway Caches
    Also known as “reverse proxy caches” or “surrogate caches,”
    but instead of being deployed by network administrators to save bandwidth, they’re typically deployed by Webmasters themselves, to make their sites more scalable, reliable and better performing.
    Requests can be routed to gateway caches by a number of methods, but typically some form of load balancer is used to make one or more of them look like the origin server to clients.