How caching and CDNs work