Last-Modified和Etag

Last-Modified是页面文件最后的修改时间,Etag相当于页面文件的hash。

http request          http respose

If-Modified-Since -> Last-Modified     时间上对比,一致则返回304

If-None-Match     ->       Etag            内容上对比,一致则返回304

在第一次请求URL的时候,服务器讲 Last-Modified和Etag返回给客户端
在第二次请求此URL的时候,客户端将 If-Modified-Since 和 If-None-Match 发送到服务器
服务器将 If-Modified-Since 与 Last-Modified,If-None-Match 与 Etag做对比,一致则
返回304,否则返回200.

Expires

服务器返回的http response header中有Expires时,浏览器会在其标记的时间内不去下载请求的内容。
仅在地址栏输入地址有效,F5刷新无效。

Pragma和Cahce-Control

Http1.0的Pragma和Http1.1的Cache-Control可以用来控制页面缓存。

Pragma->no-cache, Expires->0 ,Cache-Control->no-cahce可以让页面不缓存。
Cache-Control的max-age可以设置页面在客户端缓存多少秒,是相对时间,并且覆盖Expires

Last-Modify和Etag的更多相关文章

  1. Parallelized coherent read and writeback transaction processing system for use in a packet switched cache coherent multiprocessor system

    A multiprocessor computer system is provided having a multiplicity of sub-systems and a main memory ...

  2. 面试官:如果 http 响应头中 ETag 值改变了,是否意味着文件内容一定已经更改

    本篇文章由我的 一日一题 中的四个 Issue 组合而成 [Q111]http 响应头中的 ETag 值是如何生成的 [Q112]如果 http 响应头中 ETag 值改变了,是否意味着文件内容一定已 ...

  3. AutoMapper:Unmapped members were found. Review the types and members below. Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type

    异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 应用场景:ViewModel==>Mode映射的时候出错 AutoMappe ...

  4. Modify Branding of FreeCAD

    Modify Branding of FreeCAD eryar@163.com This article describes the Branding of FreeCAD. Branding me ...

  5. 使用ETag进行session的降级

    回顾 在web后台开发中我们经常需要存储一些变量到session中进行暂存,最为特殊的就是"购物车",由于http的无状态特性,因此我们需要在客户端打上一个标记,唯一的标示客户端并 ...

  6. -bash: ulimit: pipe size: cannot modify limit: Invalid argument

    从root账号切换到oracle账号时,出现了"-bash: ulimit: pipe size: cannot modify limit: Invalid argument"提示 ...

  7. 浏览器请求页面时Etag和cache的区别

    etag:简单的说就是服务器收到客户端的请求后,根据返回的内容计算出来一个etag值,返回给客户端,当客户端下次再请求相同路径的时候会带上之前的etag值,服务器端会根据这次请求应该返回的内容计算出新 ...

  8. HTTP参数中Etag的重要性

    在研究tornado时,有个Etag比较好奇,从网上查询摘录如下:

  9. http缓存之304 last-modified,cache-control:max-age,Etag等

    因最近客户端慢的问题,系统分析了下http协议缓存问题.本文主要记录总结http缓存相关知识. 1. 讨论涉及的要点 访问返回类 > 访问返回200 OK > 访问返回200 (from ...

  10. Cannot send session cache limiter Cannot modify header information

    当php报出  Cannot send session cache limiter 或Cannot modify header information   的错误时   其理论上是因为php代码以前有 ...

随机推荐

  1. bzoj 3224 splay模板题4

    再刷水题我就废了... #include<iostream> #include<cstdio> #include<algorithm> #include<cs ...

  2. BZOJ 4325: NOIP2015 斗地主

    4325: NOIP2015 斗地主 Time Limit: 30 Sec  Memory Limit: 1024 MBSubmit: 684  Solved: 456[Submit][Status] ...

  3. 【BZOJ-4310】跳蚤 后缀数组 + ST表 + 二分

    4310: 跳蚤 Time Limit: 20 Sec  Memory Limit: 512 MBSubmit: 180  Solved: 83[Submit][Status][Discuss] De ...

  4. spring的自动装配基础

    当开始看别人的代码使用注解的时候,以为照着别人的代码写,也写一个注释就能实现这样的功能,但是,现在开始考虑自动装配时怎样实现的. 首先,如果如果知道如何手动在xml配置中"装配bean&qu ...

  5. Hash_集合

    #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> ...

  6. 数据结构算法C语言实现(十一)--- 3.4队列的链式表示和实现

    一.简介 FIFO. 二.头文件 //3_4_part1.h /** author:zhaoyu email:zhaoyu1995.com@gmail.com date:2016-6-9 note:r ...

  7. 基本概率分布Basic Concept of Probability Distributions 4: Negative Binomial Distribution

    PDF version PMF Suppose there is a sequence of independent Bernoulli trials, each trial having two p ...

  8. (译)你应该知道的jQuery小技巧

    帮助提高你jQuery应用的简单小技巧 回到顶部按钮 图片预加载 判断图片是否加载完 自动修补破损图像 Hover切换class类 禁用输入 停止正在加载的链接 toggle fade/slide 简 ...

  9. CTO、技术总监、首席架构师的区别

    2016年11月30日13:22:26[转] CTO.技术总监.首席架构师的区别 提升自已的能力,比如专业技术,行业发展趋势,技术发展趋势,协调能力,组织能力,管理能力等[技术总监] 需要从技术总监和 ...

  10. K米评测

    调研,评测 1)评测 体验: 流畅度不足. 遥控按钮太过偏右,对大屏手机用户不够友好. ui风格不统一,矩形,圆角矩形,圆形混用,圆角矩形的圆角半径也不相同. 状态栏不是沉浸式的,观感较差,特别是白色 ...