为了账号安全,请及时绑定邮箱和手机立即绑定

无法缓存,返回码一直是200

public function behaviors()

{http://img1.sycdn.imooc.com//5849eedf0001e11016320872.jpg

return [

  //使用http缓存

  [

      'class'=>'yii\filters\HttpCache',

      'lastModified'=>function(){

      //这是一个时间戳

      //只要时间戳一致,那么就可以认为缓存一致,响应一致

         return 1432817566;

      }

  ]

];

}

public function actionIndex()

{

//echo "4";

return $this->renderPartial('index');

}


正在回答

2 回答

换个浏览器试试,或者看下chrome的设置有没有禁用缓存

0 回复 有任何疑惑可以回复我~
#1

银白的天空 提问者

非常感谢!对,换个浏览器清缓存就行了
2016-12-10 回复 有任何疑惑可以回复我~
https://vk.com/topic-210967729_48611788
https://vk.com/topic-210967729_48611792
https://vk.com/topic-210967729_48611797
https://vk.com/topic-210967729_48611799
https://vk.com/topic-210967729_48611802
https://vk.com/topic-210967729_48611831
https://vk.com/topic-210967729_48611832
https://vk.com/topic-210967729_48611835
https://vk.com/topic-210967729_48611838
https://vk.com/topic-210967729_48611843
https://vk.com/topic-210967729_48611849
https://vk.com/topic-210967729_48611853
https://vk.com/topic-210967729_48611856
https://vk.com/topic-210967729_48611858
https://vk.com/topic-210967729_48611861
https://vk.com/topic-210967729_48611862
https://vk.com/topic-210967729_48611863
https://vk.com/topic-210967729_48611866
https://vk.com/topic-210967729_48611869
https://vk.com/topic-210967729_48611870
https://vk.com/topic-210967729_48611875
https://vk.com/topic-210967729_48611880
https://vk.com/topic-210967729_48611884
https://vk.com/topic-210967729_48611887
https://vk.com/topic-210967729_48611888
https://vk.com/topic-210967729_48611891
https://vk.com/topic-210967729_48611895
https://vk.com/topic-210967729_48611898
https://vk.com/topic-210967729_48611904
https://vk.com/topic-210967729_48611908
https://vk.com/topic-210967729_48611910
https://vk.com/topic-210967729_48611914
https://vk.com/topic-210967729_48611918
https://vk.com/topic-210967729_48611920
https://vk.com/topic-210967729_48611923
https://vk.com/topic-210967729_48611927
https://vk.com/topic-210967729_48611932
https://vk.com/topic-210967729_48611935
https://vk.com/topic-210967729_48611937
https://vk.com/topic-210967729_48611938
https://vk.com/topic-210967729_48611941
https://vk.com/topic-210967729_48611946
https://vk.com/topic-210967729_48611948
https://vk.com/topic-210967729_48611952
https://vk.com/topic-210967729_48611956
https://vk.com/topic-210967729_48611958
https://vk.com/topic-210967729_48611963
https://vk.com/topic-210967729_48611966
https://vk.com/topic-210967729_48611967
https://vk.com/topic-210967729_48611970
https://vk.com/topic-210967729_48611972
https://vk.com/topic-210967729_48611975
https://vk.com/topic-210967729_48611977
https://vk.com/topic-210967729_48611979
https://vk.com/topic-210967729_48611982
https://vk.com/topic-210967729_48611985
https://vk.com/topic-210967729_48611987
https://vk.com/topic-210967729_48611988
https://vk.com/topic-210967729_48611991
https://vk.com/topic-210967729_48611993
https://vk.com/topic-210967729_48611995
https://vk.com/topic-210967729_48611996
https://vk.com/topic-210967729_48611998
https://vk.com/topic-210967729_48612005
https://vk.com/topic-210967729_48612010
https://vk.com/topic-210967729_48612013
https://vk.com/topic-210967729_48612017
https://vk.com/topic-210967729_48612026
https://vk.com/topic-210967729_48612028
https://vk.com/topic-210967729_48612029
https://vk.com/topic-210967729_48612031
https://vk.com/topic-210967729_48612034
https://vk.com/topic-210967729_48612035
https://vk.com/topic-210967729_48612037
https://vk.com/topic-210967729_48612039
https://vk.com/topic-210967729_48612043
https://vk.com/topic-210967729_48612047
https://vk.com/topic-210967729_48612050
https://vk.com/topic-210967729_48612052
https://vk.com/topic-210967729_48612054
https://vk.com/topic-210967729_48612059
https://vk.com/topic-210967729_48612064
https://vk.com/topic-210967729_48612067
https://vk.com/topic-210967729_48612070
https://vk.com/topic-210967729_48612075
https://vk.com/topic-210967729_48612079
https://vk.com/topic-210967729_48612082
https://vk.com/topic-210967729_48612086
https://vk.com/topic-210967729_48612088
https://vk.com/topic-210967729_48612091
https://vk.com/topic-210967729_48612096
https://vk.com/topic-210967729_48612101
https://vk.com/topic-210967729_48612104
https://vk.com/topic-210967729_48612106
https://vk.com/@712774205-94363
https://vk.com/@712534118-38149
https://vk.com/@712782889-122045
https://vk.com/@712781708-92629
https://vk.com/@712782082-144307
https://vk.com/@712782483-51156


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Yii框架不得不说的故事—高效篇(2)
  • 参与学习       22811    人
  • 解答问题       46    个

本教程代领大家学习YII如何提升程序运行效率以及开发效率

进入课程

无法缓存,返回码一直是200

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信