symfony-cli / symfony-cli

The Symfony CLI tool
https://symfony.com/download
GNU Affero General Public License v3.0
507 stars 102 forks source link

Support ESI #388

Open dkarlovi opened 7 months ago

dkarlovi commented 7 months ago

When running in local mode, it would be nice to be able to test ESI.

This would allow the developer to make sure the feature is fully working and not falling back to Symfony subrequests.

One implementation of ESI for Go is go-esi which is used by Caddy's cache handler (via souin).

Edit: it was pointed out to me by @stof Symfony's HttpCache already supports ESI. This is closer to the desired behaviour, but it means you still rely on the app doing something "special" (which it already does with the current subrequest fallback), the approach where symfony does the ESI and the app just naturally responds to it (like it would behind a production server) feels like a much cleaner approach.

tucksaun commented 7 months ago

why not that could be a nice feature. especially when you want to use the CLI with a project that does use Symfony or are migrating and use an hybrid project. we just need to be careful not breaking responses streaming that we recently introduced :)

though the limitation I see is that we are not going to support responses caching so it might be the limiting factor compared to HttpCache.

dkarlovi commented 7 months ago

@tucksaun IMO actual caching is not really important because you're obviously not implementing the whole cache stack like Varnish, we can treat the ESI requests like they always "miss" cache, you still get the value of your app being "inspected for ESI" from the outside.