2016-04-11 6 views
0

こんにちは私は次の問題があります。多くのユーザーがWebサイトを利用できるようにするため、Larnvel 5.1を実行するWebサイトを用意しています。また、Varnish4を使用してより高速な読み込み時間を持つことができます。私のワニスvlcファイルは次のとおりです。esiタグがlaravelアプリケーションで動作しません

backend default { 
    .host = "127.0.0.1"; 
    .port = "80"; 
} 

sub vcl_recv { 
    # Happens before we check if we have this in cache already. 
    # 
    # Typically you clean up the request here, removing cookies you don't need, 
    # rewriting the request, etc.  
    unset req.http.Cookie; 
} 

sub vcl_backend_response { 
    unset beresp.http.Set-Cookie; 
    set beresp.do_esi = true; 
    set beresp.ttl = 1m; 
    return(deliver); 
} 

あなたは私がすべての要求のためのESI processignイネーブル(ないのベストプラクティスを、私は物事を動作させるためにしようとしている)、およびvcl_recvサブルーチン内のすべてのクッキーを削除見ることができるように。

は今、私は、ESIとブレードのテンプレートを持って次のようにブロックを含める:

<esi:remove> 
    NO ESI SUPPORT 
    <script>window.load_hot = true;</script> 
</esi:remove> 
<!--esi 
    <p>The full text of the license: 
     <esi:include src="http://localhost/date.php" /> 
    </p> 
--> 

ESI上のルートは、タグがOK働くと予想される出力を返します。 ワニスシステムは、フォールバック(show NO ESI SUPPORT)メッセージが表示されないため、期待通りにESIブロックを解析します。

このコードでは何が問題になりますか?

答えて

0

esi:includeタグは、プロトコルとホスト名などを含む完全なURLではなく、パスのみを使用します。

<esi:include src="/cgi-bin/date.cgi"/> 

参照:https://www.varnish-cache.org/docs/4.1/users-guide/esi.html

+0

申し訳ありませんが、これは問題ではありませんでした。 esi:includeタグの絶対URLを持つ私の答えをチェックする – asolenzal

0

解決しました。何らかの理由で

この:

<esi:remove> 
    NO ESI SUPPORT 
    <script>window.load_hot = true;</script> 
</esi:remove> 
<!--esi 
    <p>The full text of the license: 
     <esi:include src="http://localhost/date.php" /> 
    </p> 
--> 

は、タグによる働いていませんでした。期待どおりに動作し始め

<esi:remove> 
    NO ESI SUPPORT 
    <script>window.load_hot = true;</script> 
</esi:remove> 

<p>The full text of the license: 
     <esi:include src="http://localhost/date.php" /> 
</p> 

ESIの包含:このようにタグを除去した後

関連する問題