缓存 Cache-Control:max-age symfony
生活随笔
收集整理的這篇文章主要介紹了
缓存 Cache-Control:max-age symfony
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1、代碼設(shè)置:
(注釋方式)use?Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;/**??@Cache(smaxage="3600",?maxage="3600",?public=true)??*/(手動方式)
$cacheTime?=?3600;
$response?=?new?JsonResponse($channelDatas,?200);
$response->setPublic()->setMaxAge($cacheTime)->setSharedMaxAge($cacheTime);2、nginx?配置location?~?\.php($|/)?{include?fastcgi_params;fastcgi_pass?127.0.0.1:9000;fastcgi_cache?fastcgicache;??//必須加上}
轉(zhuǎn)載于:https://blog.51cto.com/shjandphp/1951426
《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的缓存 Cache-Control:max-age symfony的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关闭服务器
- 下一篇: unrecognized font fa