Symfony HTTP缓存在3.4中不起作用 [英] Symfony HTTP Cache doesn't work in 3.4

查看:53
本文介绍了Symfony HTTP缓存在3.4中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Symfony 3.2中测试了代码形式 Symfony文档很好,但是缓存在3.4.8中不起作用.

I've tested code form Symfony Docs in Symfony 3.2 and it was everything good, but cache doesn't work in 3.4.8.

当然,我想使用Symfony反向代理.

Of courese I want to use Symfony Reverse Proxy.

我的 app_dev.php

$kernel = new AppKernel('dev', true);
if (PHP_VERSION_ID < 70000) {
    $kernel->loadClassCache();
}
$kernel = new AppCache($kernel);

我的动作看起来像这样:

My action look's like this:

public function indexAction(Request $request)
{
    // [...]
    $response = $this->render('base.html.twig');

    $response->setSharedMaxAge(3600);

        return $response;
}

我是否缺少某些东西,那不是Symfony 3.2中的nessesery吗?

Am I missing something, that isn't nessesery in Symfony 3.2?

推荐答案

我发现它是不可能的,因为它有一些Symfony 3.4错误.我改用了Symfony缓存组件 https://symfony.com/doc/current/components/cache.html .

I found it's imposible, by some Symfony 3.4 bug. I used Symfony Cache Component instead https://symfony.com/doc/current/components/cache.html.

这篇关于Symfony HTTP缓存在3.4中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆