How do I enable basic ESI in my VCL?

Comments

7 comments

  • Leo Lapworth

    Can fastly then compress the output to the client, ie. after the esi has been processed?

    0
    Comment actions Permalink
  • Austin Spires

    @ranguard not at the moment, though we're actively working on supporting this :smiley:. Depending on the way you're using ESI, conditionally deactivating gzipping for ESI content may be workable in the interim. But, if you're gzipping a significant portion of your content, this isn't ideal.

    0
    Comment actions Permalink
  • Andri Antoniades

    To see an example of ESI logic already inserted into Fastly's boilerplate, please visit this public Github repo, which also contains examples of CSRF tags in HTML: https://github.com/andriantoniades/Using-ESI-with-Boilerplate-VCL

    And to check out more examples of how you can use ESI logic, visit our follow-up ESI Community Page: https://community.fastly.com/t/examples-of-esi-logic-in-custom-vcl/278

    0
    Comment actions Permalink
  • TimWeyand

    Hi,

    not at the moment, though we're actively working on supporting this

    has there been any progress in allowing ESI and compression? We have moved to fastly last Year and one of the reasons was support for ESI. We had to drop it temporarily from our Websites to allow everything to work, but my developers are still sad - that we can't use it right now.

    Best, Tim

    0
    Comment actions Permalink
  • Justin

    Hi @TimWeyand

    We currently have an implementation that some customers are using, but it's not been made generally available. There are a few criteria that need to be in place to use it, but to find out more, and if it'll be available for you to use, send in a support ticket and we'll let you know.

    0
    Comment actions Permalink
  • Chaim Klar

    regarding the following code:

    sub vcl_recv {
        if (req.http.Fastly-FF) {
            set req.esi = false;
        }
    }

    we came across some user complaints where the page stopped rendering at right before the "<esi:include.." tag, so we removed above code and issue was fixed.

    do we make sense?

    0
    Comment actions Permalink
  • Justin

    Hi Chaim Klar

    That code is intended to make sure ESI is only executed on the shield POP nodes and not in the edge POP.

    If you found that disabling it made things work it suggests something is wrong.  If you need assistance do feel free to open a support ticket using our Support Portal, or via an email to support@fastly.com.

    0
    Comment actions Permalink

Please sign in to leave a comment.