Yarn is experiencing an issue with Discourse stripping ESI tags when adding a custom footer. The ESI tag <esi:include src="http://www.xyz.abc/esi_parts/footer" /> is converted to <include src="http://www.xyz.abc/esi_parts/footer"></include> or sometimes removed altogether. sam explained that this is because the footer is dynamically added and any mangling by Varnish occurs too late. Yarn questioned this, but sam clarified that the footer is passed to the SPA as a JSON blob, making it difficult for Varnish to inject ESI tags. Yarn acknowledged the explanation.
When discourse serveres the page back to Varnish it will inject the content into the page. However when we customize our theme (using the editor within the admin panel) and add the line above to the footer then on page load we see in the page source that its converted the above to:
Thanks but how is that possible since Varnish sits in front of Discourse and serves the page to the browser. So varnish requests the page from Discourse and once received it can cache it if necessary and also inject ESI’s and other things. How can discourse prevent that? (other than by refusing to allow the esi:include tag in the markup)