On 08.04.2011 14:57, Christophe COEVOET wrote:
> Le 08/04/2011 14:51, Jordi Boggiano a écrit :
>> Yeah generating and parsing ESI tags in JSON is gonna be pretty
>> difficult, and I'm not sure Varnish will do it at all.
> Varnish will follow the spec: replacing <esi:include src="..." /> by the
> content of the URL. Nothing more.
> The response containing the ESI tag will not be a valid JSON response.
> Only the parsed one should (if you send the good content). The issue is
> generating the response containing the ESI tag as this will forbid you
> to simply use json_encode to create the content.

Well this can fairly simply be achieved by doing:

json_encode(array('foo' => "%include:$url%"))
preg_replace("#'%include:(url)%'#", '<esi:include src="$1"/>', $json)

This could even be done in a core.response listener.

Cheers

-- 
Jordi Boggiano
@seldaek :: http://seld.be/

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to