I've started using ESI's in Akamai. They work perfectly fine when I've got a site running on int/test/stage/production environments which actually run through Akamai.
However, when we work locally on a PC, we tend to just use a simple jetty server and the site is not served using Akamai. This makes it a bit challenging to see if the work is correct without deploying our solution to Akamai.
Is there a way to simulate an ESI locally for development without using Akamai?
I could not find any official way of doing this, so I emulated a ESI on the server side as if it were an SSI, using an IF statement in our freemarker.
I use spring, freemarker + java to do this solution:
1) Create a macro that will decide to use the ESI or emulate it via SSI if running local (noescape may not be required, depends how you have set things up)
2) use the macro with the url <@html.esi url="my/url" />
3) Exposed the SSI Include method in java/spring (you'll need to have setup some environment specific values for esiUrl and the sites base url)
4) The java to emulate a SSI in freemarker