Hacker News new | ask | show | jobs
by mhotchen 3519 days ago
Well just take the example on their page for example. With ESI you would fire off to a server process that has to then go seek a user, then build up some HTML using a templating language in python or whatever you're using and return it to varnish.

With edgestash it looks like varnish holds the template, compiles it, caches it, then injects values in to it from JSON, which is easier for the server to generate and easier for varnish to inject the values from.

For HTML that's very dynamic based on user data ESI isn't an ideal solution, you either end up with a ton of includes (and thus a ton of requests), or you end up basically having only the shell of a web page cached by varnish. With edgecache you would have a single request (or a handful) returning all the data as JSON, and varnish would have a cache of basically the entire page to inject the values in to. Your server-side code doesn't have to deal with HTML at all, it just provides data. I'd say it's less competitive with ESI and more closely competing with single page apps, but you're moving the load back on to your server so clients aren't downloading javascript for injecting data in to HTML templates.