ESI for Fastly
This crate provides a streaming Edge Side Includes parser and executor designed for Fastly Compute.
The implementation is a subset of the ESI Language Specification 1.0 supporting the following tags:
<esi:include>(+alt,onerror="continue")<esi:try>|<esi:attempt>|<esi:except><esi:comment><esi:remove>
Other tags will be ignored and served to the client as-is.
Example Usage
use ;
See example applications in the examples subdirectory or read the hosted documentation at docs.rs/esi. Due to the fact that this processor streams fragments to the client as soon as they are available, it is not possible to return a relevant status code for later errors once we have started streaming the response to the client. For this reason, it is recommended that you refer to the esi_example_advanced_error_handling application, which allows you to handle errors gracefully by maintaining ownership of the output stream.
Testing
In order to run the test suite for the packages in this repository, viceroy must be available in your PATH. You can install the latest version of viceroy by running the following command:
License
The source and documentation for this project are released under the MIT License.