我嘗試配置清漆,以便它可以處理jsonp。
我爲基本理念用這個來源:https://gist.github.com/640331用清漆處理jsonp
我使用清漆3.0.2所以我結束了with this
發送請求到服務器後:
curl http://example.com/test?callback=test
我得到以下:
test(<esi:include src="http://example.com/test" />);
insted的的:
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?
你有沒有得到這個解決? – trimbletodd