2012-05-09 8 views
1

jsonpを処理できるようにワニスを構成しようとしています。 https://gist.github.com/640331ワニス付きjsonpを扱う

私はので、私はサーバーにリクエストを送信した後

with thisを終わったワニス3.0.2を使用しています:私は取得

curl http://example.com/test?callback=test 


私は基本的な概念として、このソースを使用します次

test(<esi:include src="http://example.com/test" />); 

のInsted:

test({...cached-json...}); 

のsyslog出力:JSONを取得するには、ESIリクエストを評価する方法

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 

+0

あなたは今まで、これは解決したのですか? – trimbletodd

答えて

1

解決策が見つかりました! Looks like this

あなたがあなたのJSON応答のGZIPを使用している場合は、JSONPのためにgzipを有効にすることを忘れないでください:

if (beresp.http.content-type ~ "application/javascript") { 
    set beresp.do_gzip = true; 
} 
+0

リンクが壊れているようです。更新された例がありますか? – mrmagooey

+1

私はリンクを更新しました。それは再び働いている。 – czerasz

関連する問題