Service Extensions lets you use extensions to insert custom code in the Media CDN processing path. This page provides an overview about Media CDN extensions.
Media CDN provides many built-in core capabilities to address the most common use cases for content delivery networks (CDNs). You might have requirements beyond these capabilities. For example, you might need to normalize headers to improve caching, use a custom URL signing algorithm, or port legacy behavior from an existing CDN to Media CDN.
Service Extensions helps you add custom code for lightweight compute use cases in the request and response processing paths by using plugins. Plugins can access and manipulate HTTP request and response headers and then serve synthetic responses. Plugins can also perform additional actions such as HTTP redirects and URL rewrites.
As Figure 1 shows, with Service Extensions, you can use plugins to place custom code that implements specific actions at the edge, in front of the cache in the Media CDN processing path.
How Media CDN plugins work
On the Media CDN request path, plugins run after route matching and Google Cloud Armor edge security policies but before cache key calculation and the addition of custom headers to the origin.
On the response path, plugins run after content is served from cache, allowing for cached content to be manipulated.