2

アクションが小枝でレンダリングされるコントローラーがあります

{{ render_esi(controller('MyWebsiteBundle:Element:header')) }}

アクション自体は次のようになります。

/**
     * @return Response
     */
    public function headerAction()
    {
        $currentLocale = $this->getCurrentLocale();

        $response = $this->render('MyWebsiteBundle:Element:header.html.twig', array(
            'currentLocale' => $currentLocale,
            'myTime' => time()
        ));
        $response->setPublic();
        $response->setSharedMaxAge(3600);

        return $response;
    }

ブラウザをリロードすると、"myTime"毎回変更されます。

setShardeMaxAge()MaxAge の有効期限が切れた後にのみ Twig がレンダリングされるように、を使用するにはどうすればよいですか?

4

1 に答える 1