GCP – Run your own code at the edge with Service Extensions plugins for Cloud CDN
At Google Cloud, we’re committed to delivering the best performance possible globally for web and API content. Cloud CDN is a high-performance edge caching solution that runs at over 200 points of presence, and we continue to add more features and capabilities to it. Recently we launched invalidation with cache tags, device characterization, 0-RTT early data, and geo-targeting. These powerful first class features address many use cases, but organizations tell us they also need a more flexible, lightweight, edge computing solution.
We are excited to announce that you can now run Service Extensions plugins with Cloud CDN, allowing you to run your own custom code directly in the request path in a fully managed Google environment with optimal latency. This allows you to customize the behavior of Cloud CDN and the Application Load Balancer to meet your business requirements.
Service Extensions plugins with Cloud CDN supports the following use cases:
-
Custom traffic steering: Manipulate request headers to influence backend service selection.
-
Cache optimization: Influence which content is served from a Cloud CDN cache.
-
Exception handling: Redirect clients to a custom error page for certain response classes.
-
Custom logging: Log user-defined headers or custom data into Cloud Logging.
-
Header addition: Create new headers relevant for your applications or specific customers.
-
Header manipulation: Rewrite existing request headers or override client headers on their way to the backend.
-
Security: Write custom security policies based on client requests and make enforcement decisions within your plugin.
- aside_block
- <ListValue: [StructValue([(‘title’, ‘$300 to try Google Cloud networking’), (‘body’, <wagtail.rich_text.RichText object at 0x3e6d90586d30>), (‘btn_text’, ‘Start building for free’), (‘href’, ‘http://console.cloud.google.com/freetrial?redirectpath=/products?#networking’), (‘image’, None)])]>
Where you can run your code
Service Extensions plugins run at multiple locations in the request and response processing path. With this launch, you can run plugins before requests to Cloud CDN using an edge extension. In a previous launch, we added the capability to run plugins post the Cloud CDN cache, closer to the origin, via a traffic extension. Now, with support for both edge and traffic extensions, you can choose where you want your code to execute in the processing path.
Service Extensions deep dive
Service Extensions plugins are designed for lightweight compute operations that run as part of the Application Load Balancer request path. Plugins are built on WebAssembly (Wasm), which provides several benefits:
-
Near-native execution speed, and startup time in the single milliseconds
-
Support for a variety of programming languages, such as Rust, C++, and recently Go
-
Cross-platform portability, so you can run the same plugin in various deployments, or locally for testing
-
Security protections, such as executing plugin logic in a sandboxed environment
Service Extensions plugins leverage Proxy-Wasm, a Google-supported open source project that provides a standard API for Wasm modules to interface with network proxies.
Use Cloudinary’s image & video optimization solution
We are excited to announce our latest partner to integrate their offering with Service Extensions and Cloud CDN. Cloudinary makes an advanced image and video optimization solution and has integrated it with Service Extensions plugins for deployment to Cloud CDN customers.
Packaged as a Wasm plugin, Cloudinary’s plugin takes directives from Client Requests such as User-Agent information, and content type expressed as MIME types from HTTP Accept headers, to determine the most optimal media type to serve to the end user. The plugin also takes care of Cache Key normalization so that the images and videos are cached properly based on device types and content types.
“Cloudinary’s image and video solutions help customers manage and optimize their visual media assets at scale while ensuring they are optimized for the best format, device, channel and viewing context. We are excited to partner with the Google team to offer Cloudinary’s image and video optimization solutions to Cloud CDN customers via Service Extensions.” – Gary Ballabio, VP, Strategic Technology Partnerships, Cloudinary
For more information on Cloudinary’s solution, please review this guide.
What’s next
To get started with Service Extensions plugins, take a look at our growing samples repository with a local testing toolkit and follow our quickstart guide in the documentation.
Read More for the details.