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里面的视频文件进行上传,为了用户体验,我们有必要实现断点上传.其实也不是真的断点,这里我们只是模仿断点机制. ...
随机推荐
- List中的Contains方法内部其实是用对象的equals方法做比较,所以如果比较两个类就重写类的equals方法即可;而Set是调用equals和hashCode
public class Person { private String name; private int age; public String getName() { return name; } ...
- Redis 操作集合数据
Redis 操作集合数据: > sadd set1 Tom // sadd 用于往集合中添加元素 (integer) > sadd set1 John (integer) > sad ...
- Unity透明Shader
Shader "Custom/Blocks" { Properties { _Color (,,,) _MainTex ("Albedo (RGB)", 2D) ...
- zabbix创建触发器
1. 增加触发器 配置-->主机-->选择主机-->创建触发器 2. 配置触发器 3.查看触发器的状态 如果有问题会显示红色的问题
- C#编码习惯谈
1. 避免将多个类放在一个文件里面.2. 一个文件应该只有一个命名空间,避免将多个命名空间放在同一个文件里面.3. 一个文件最好不要超过500行的代码(不包括机器产生的代码).4. 一个方法的 ...
- 在MVC中实现和网站不同服务器的批量文件下载以及NPOI下载数据到Excel的简单学习
嘿嘿,我来啦,最近忙啦几天,使用MVC把应该实现的一些功能实现了,说起来做项目,实属感觉蛮好的,即可以学习新的东西,又可以增加自己之前知道的知识的巩固,不得不说是双丰收啊,其实这周来就开始面对下载在挣 ...
- 处理i18n国际电话区号的代码实践
本文转载至 http://adad184.com/2015/08/18/practice-in-i18n-dialling-code/ 前言 上周在忙产品的国际化(i18n)的问题 其中一个很重要的地 ...
- 【LeetCode OJ】Median of Two Sorted Arrays
题目链接:https://leetcode.com/problems/median-of-two-sorted-arrays/ 题目:There are two sorted arrays nums1 ...
- Tomcat的目录结构和配置文件详解
本文转载: https://www.zybuluo.com/1234567890/note/515235 参考帖子: Tomcat(一):基础配置详解 Tomcat服务器中配置多个域名,访问不同的we ...
- XML读取(string形式进行读取)
#region 测试XML二进制读取 string strXmlData = "<xml><ToUserName><![CDATA[gh_ef65912f88f ...