Altering dynamic and static content CDN's


I’m trying to understand few things about Cloudflare’s cache mechanism.

Cloudflare Workers, for example, are serverless JavaScript functions that run on the Cloudflare CDN. They can respond to a variety of events and inputs, including device type, time of day, user location, or data from third-party APIs. Based on these parameters, dynamic content can be generated and served to client devices, or static content can be altered, cached, or purged from the cache.

In this article from the statement, it is stated that based on the location, time and date, etc. static content can be changed. I would like to know in detail about that and how does it work?