Modifying HTTP response streams at the edge allows for dynamic content updates without needing to contact the origin server. This improves performance and provides flexibility in delivering up-to-date information to users.
Loading...
https://www.edgecompute.live/edgeworkers/stream/findReplaceDemo.html
Copied to clipboard!
Demonstrates how an EdgeWorker can modify an HTTP response stream by performing a find & replace operation on the response. The example searches for specific text and replaces it with another across the entire response body. It accepts an optional parameter to specify the number of replacements. If not specified, the replacement occurs as many times as possible. The demo replaces ““This is the original string”” with ““This is the updated string””.
Dynamic Flexibilty
Modify in-flight content on its way between client and origin server and back to clients.
Ease Development
Enable developers to modify application behavior without touching origin server logic.