【发布时间】:2014-09-19 21:19:16
【问题描述】:
我正在尝试为我的应用程序使用 HTTP 缓存,但每次我将缓存设置为私有时,它都不会出现在 app/cache 文件夹中。
对于公共缓存一切正常,正在生成文件/文件夹。
这是我缺少的东西吗?我正在尝试为需要身份验证的网站部分生成缓存。因此缓存应该针对每个用户名,因为它只为该用户提供报告。
这就是我正在做的:
$response = $this->render('myTemplate.html.twig', array(
'username' => $username
));
$response->setMaxAge(600);
$response->setPrivate();
return $response;
【问题讨论】:
标签: php symfony caching http-caching