Akamai provides their own version of an ESI testing server found here:
Of course it’s not open source, it’s a pre-compiled binary and “Caching of template and fragments is not supported”. Who would shoot themselves in the foot by providing a free version of their commercial offering? Ok yes, Red Hat does but moving on…
I grabbed the FC7 version for CentOS 5.5, extracted, ran the install script with an ETS listening on port 80 and origin host at localhost and port 81. Turn on ESI Debugging too, it’s rather informative being able to view the source with ESI tags and the actions of the server on those tags. To see the debug info view the page source of a request since they’re hidden.
Edit the standard Apache install at /etc/httpd/conf/httpd.conf and change it to listen on port 81.
After setting up Symfony 2′s native ESI handling demo as detailed here:
Akamai’s config will need a couple headers in order for Symfony to respond with ESI tags in the response.
Edit the Akamai config here: /usr/local/ETS/conf/httpd.conf
Edit the VirtualHost directive near the end of the file and add these two directives:
Now Symfony 2 will see that an ESI Surrogate is making a request and it will respond with the ESI tag instead of filling it in. Develop your app using port 81 and test your ESI through port 80. View the page source to see the debugging info if debugging is enabled.
This guide is similar to the cookbook entry for Varnish which also requires that the surrogate header be set: