如何在 Symfony 中将 Cache-Control 设置为 no-cache - FOSHttpCacheBundle

Meh*_*mar 5 caching cache-control browser-cache symfony foshttpcachebundle

问题:即使在注销后,点击浏览器中的后退按钮也会呈现安全页面的缓存版本。

我正在尝试使用FOSHttpCacheBundle. 这是我的配置:

fos_http_cache:
cache_control:
    defaults:
        overwrite: true
    rules:
        -
            match:
                path: ^/
            headers:
                cache_control: { no_cache: true }
Run Code Online (Sandbox Code Playgroud)

虽然可以设置Cache-Control:no-cache, private但没有Pragma: no-cacheExpires: -1头文件中定义了根据文档应当被定义。

这是我的响应标头:

Cache-Control:no-cache, private
Connection:Keep-Alive
Content-Type:text/html; charset=UTF-8
Date:Tue, 03 May 2016 09:03:49 GMT
Keep-Alive:timeout=5, max=95
Server:Apache/2.4.9 (Win64) PHP/5.5.12
Transfer-Encoding:chunked
X-Cache-Debug:1
X-Debug-Token:050e09
X-Debug-Token-Link:/app_dev.php/_profiler/050e09
X-Powered-By:PHP/5.5.12
Run Code Online (Sandbox Code Playgroud)

有人请解释我错过了什么!!

谢谢