我尝试配置清漆,以便它可以处理 jsonp。
我使用这个来源作为基本概念:https ://gist.github.com/640331
我正在使用 varnish 3.0.2 所以我最终得到了这个
向服务器发送请求后:
curl http://example.com/test?callback=test
我得到以下信息:
test(<esi:include src="http://example.com/test" />);
安装:
test({...cached-json...});
系统日志输出:
The syslog outputs the following:
May 09 12:48:45 [varnishd] before if for: /JSONP-ESI-TEMPLATE
May 09 12:48:45 [varnishd] before if for: callback, url: example.com:6081
May 09 12:48:45 [varnishd] in if for: callback, url: example.com:6081
May 09 12:52:40 [varnishd] before if for: /JSONP-ESI-TEMPLATE
May 09 12:52:40 [varnishd] in if for: /JSONP-ESI-TEMPLATE
May 09 12:52:40 [varnishd] before if for: obj.status == 760
May 09 12:52:40 [varnishd] in if for: obj.status == 760
May 09 12:52:40 [varnishd] before if for: beresp.http.X-ESI
May 09 12:52:40 [varnishd] in if for: beresp.http.X-ESI
May 09 12:52:40 [varnishd] before if for: beresp.http.X-JSONP-Server
May 09 12:52:40 [varnishd] in if for: beresp.http.X-JSONP-Server
如何评估 esi 请求以获取 json?