Pragma: no-cache
Caching—both in Web browsers and proxy servers—can be affected using PHP’s header() function. Four header types are involved:
• Last-Modified
• Expires
• Pragma
• Cache-Control
The first three header types are part of the HTTP 1.0 standard. The Last-Modified header uses a UTC(Coordinated Universal Time) date-time value. If a caching system sees that the Last-Modified valueis more recent than the date on the cached version of the page, it knows to use the new version from the server. Expires is used as an indicator as to when a cached version of the page should no longer be used (inGreenwich Mean Time).
Setting an Expires value in the past should always force the page from theserver to be used:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Pragma is just a declaration for how the page data should be handled. To avoid caching of a page, use
header("Pragma: no-cache")
The Cache-Control header was added in HTTP 1.1 and is a more finely tuned option.
Directive Meaning
public Can be cached anywhere
private Only cached by browsers
no-cache Cannot be cached anywhere
must-revalidate Caches must check for newer versions
proxy-revalidate Proxy caches must check for newer versions
max-age A duration, in seconds, that the content is cacheable
s-maxage Overrides the max-age value for shared caches
Keep all systems from caching a page
header("Last-Modified: Mon, 26 Jul 2016 05:00:00 GMT"); //Right now!
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); //Way back then!
header("Pragma: no-cache");
header("Cache-Control: no-cache");
Pragma: no-cache的更多相关文章
- META元素使用的简单学习
meta标签是我们学习html时容易忽略的标签,其实它的作用很大,下面就一些网上关于meta标签的讲解内容做一个简单的归纳. META标签共有两个属性,它们分别是Http-equiv属性和Name属性 ...
- snoopy 强大的PHP采集类使用实例代码
下载地址: http://www.jb51.net/codes/33397.html Snoopy的一些特点: 1抓取网页的内容 fetch 2 抓取网页的文本内容 (去除HTML标签) fetcht ...
- PHP抓取采集类snoopy介绍
PHP抓取采集类snoopy介绍 一个PHP的抓取方案 在 2011年07月04日 那天写的 已经有 10270 次阅读了 感谢 参考或原文 服务器君一共花费了14.288 ms进行了2次 ...
- snoopy(强大的PHP采集类) 详细介绍
Snoopy是一个php类,用来模拟浏览器的功能,可以获取网页内容,发送表单,可以用来开发一些采集程序和小偷程序,本文章详细介绍snoopy的使用教程. Snoopy的一些特点: 抓取网页的内容 fe ...
- iOS 断点上传文件
项目开发中,有时候我们需要将本地的文件上传到服务器,简单的几张图片还好,但是针对iPhone里面的视频文件进行上传,为了用户体验,我们有必要实现断点上传.其实也不是真的断点,这里我们只是模仿断点机制. ...
- 记录一个nginx的配置
rt #user xiaoju; worker_processes ; #error_log logs/error.log notice; #error_log logs/error.log debu ...
- SDWebImage源码解析
但凡经过几年移动开发经验的人去大公司面试,都会有公司问到,使用过哪些第三方,看过他们的源码嘛?而SDWebImage就是经常被面试官和应聘者的提到的.下面将讲述SDWebImage的源码解析以及实现原 ...
- SDWebImage之SDImageCache
SDImageCache和SDWebImageDownloader是SDWebImage库的最重要的两个部件,它们一起为SDWebImageManager提供服务,来完成图片的加载.SDImageCa ...
- python scrapy 登录知乎过程
前面了解了scrapy框架的大概各个组件的作用, 现在要爬取知乎数据,那么第一步就是要登录! 看下知乎的登录页面发现登录主要是两大接口 一: 登录页面地址,获取登录需要的验证码,如下图 打开知乎登录页 ...
- iOS通过切片仿断点机制上传文件
项目开发中,有时候我们需要将本地的文件上传到服务器,简单的几张图片还好,但是针对iPhone里面的视频文件进行上传,为了用户体验,我们有必要实现断点上传.其实也不是真的断点,这里我们只是模仿断点机制. ...
随机推荐
- NetBpm 配置篇(2)
转载注明出处:http://www.cnblogs.com/anbylau2130/p/3877353.html 上一篇中介绍了Netbpm在IIS和CassiniWebServer服务器的安装 通过 ...
- [AX2012]关于财务默认维度
和以前的版本一样,AX2012中很多地方都使用财务维度,比如客户.销售订单.销售订单行等,根据相应的财务维度设置,生成的相应财务分录将带有财务维度,方便后续对财务分录交易的分析.下图是在客户记录上设置 ...
- x264编码的图像出现乱码的问题
将YUV进行x264编码的时候,建议将 i_threads 参数设置成 X264_SYNC_LOOKAHEAD_AUTO//* 取空缓冲区继续使用不死锁的保证. 否则有可能编码出来的数据会出现IDR_ ...
- selenium之 chromedriver与chrome版本映射表(更新至v2.31)
转自:http://blog.csdn.net/huilan_same/article/details/51896672 chromedriver版本 支持的Chrome版本 v2.31 v58-60 ...
- Selenium 延时等待
在 Selenium 中, get() 方法会在网页框架加载结束后结束执行,此时如果获取 page_source ,可能并不是浏览器完全加载完成的页面: 如果某些页面有额外的 Ajax 请求,我们在网 ...
- mysql分组查询获取组内某字段最大的记录
id sid cid 1 1 12 1 23 2 1 以sid分组,最后取cid最大的那一条,以上要取第2.3条 1 方法一: select * from (select * from table o ...
- 解决layui下拉选择框只能选择不能手动输入文字
审查元素可以看到,layui的select下拉框是用input和div模拟出来的,所以,如下例子,我的解决方法是:$('.mySelect').find('input').removeAttr(&qu ...
- java 读写文件例子
在linux下可以读写中文 import java.io.*; import java.text.SimpleDateFormat; import java.util.*; public class ...
- c++对象的生命周期
C++ 的new 运算子和C 的malloc 函数都是为了配置内存,但前者比之后者的优点是,new 不但配置对象所需的内存空间时,同时会引发构造式的执行. 所谓构造式(constructor),就是对 ...
- springmvc接收前台(可以是ajax)传来的数组list,map,set等集合,复杂对象集合等图文详解
参考帖子: http://blog.csdn.net/wabiaozia/article/details/50803581 方法参考: { "token":"" ...