`

apache能缓存数据说明

 
阅读更多

What Can be Cached?

As mentioned already, the two styles of caching in Apache work differently, mod_file_cache caching maintains file contents as they were when Apache was started. When a request is made for a file that is cached by this module, it is intercepted and the cached file is served.

mod_cache caching on the other hand is more complex. When serving a request, if it has not been cached previously, the caching module will determine if the content is cacheable. The conditions for determining cachability of a response are;

  1. Caching must be enabled for this URL. See the CacheEnable and CacheDisable directives.
  2. The response must have a HTTP status code of 200, 203, 300, 301 or 410.
  3. The request must be a HTTP GET request.
  4. If the request contains an "Authorization:" header, the response will not be cached.
  5. If the response contains an "Authorization:" header, it must also contain an "s-maxage", "must-revalidate" or "public" option in the "Cache-Control:" header.
  6. If the URL included a query string (e.g. from a HTML form GET method) it will not be cached unless the response specifies an explicit expiration by including an "Expires:" header or the max-age or s-maxage directive of the "Cache-Control:" header, as per RFC2616 sections 13.9 and 13.2.1.
  7. If the response has a status of 200 (OK), the response must also include at least one of the "Etag", "Last-Modified" or the "Expires" headers, or the max-age or s-maxage directive of the "Cache-Control:" header, unless the CacheIgnoreNoLastMod directive has been used to require otherwise.
  8. If the response includes the "private" option in a "Cache-Control:" header, it will not be stored unless the CacheStorePrivate has been used to require otherwise.
  9. Likewise, if the response includes the "no-store" option in a "Cache-Control:" header, it will not be stored unless the CacheStoreNoStore has been used.
  10. A response will not be stored if it includes a "Vary:" header containing the match-all "*".

What Should Not be Cached?

In short, any content which is highly time-sensitive, or which varies depending on the particulars of the request that are not covered by HTTP negotiation, should not be cached.

If you have dynamic content which changes depending on the IP address of the requester, or changes every 5 minutes, it should almost certainly not be cached.

If on the other hand, the content served differs depending on the values of various HTTP headers, it might be possible to cache it intelligently through the use of a "Vary" header.

Variable/Negotiated Content

If a response with a "Vary" header is received by mod_cache when requesting content by the backend it will attempt to handle it intelligently. If possible, mod_cache will detect the headers attributed in the "Vary" response in future requests and serve the correct cached response.

If for example, a response is received with a vary header such as;

Vary: negotiate,accept-language,accept-charset

mod_cache will only serve the cached content to requesters with accept-language and accept-charset headers matching those of the original request.

分享到:
评论

相关推荐

    借助Ehcache缓存框架实现对页面的缓存Demo

    Ehcache 对象、数据缓存:http://ehcache.org/downloads/destination?name=ehcache-core-2.5.2-distribution.tar.gz&bucket=tcdistributions&file=ehcache-core-2.5.2-distribution.tar.gz Web页面缓存:...

    upupw_Apache_PHP5.5

    12、temp temp目录为session文件存储、临时上传文件、数据缓存目录 13、upcore upcore为UPUPW程序的附属目录 14、vhosts vhosts为虚拟主机默认存储目录,建立在此目录的网站文件夹在UPUPW迁移时无需再修改虚拟主机...

    Permission Base(授权基础,以下简称PB)是一个基于.NET 2.0平台开发的开源项目,使用的协议为:Apache License Version 2.0。

    3 PB也并不是集群系统,即不能在集群环境下部署,这主要是因为目前使用的缓存策略导致的。 3.使用的技术、工具和产品开发平台 .NET 2.0.50727 IDE Visual Studio 2005 Pro/Team UML设计 Sybase PowerDesigner ...

    Apache系列UPUPW PHP7.0正式版1512.1(64位)

    特别说明: PHP官方从PHP5.5开始不再支持Windows XP和2003系统,所以PHP7.0不再提供支持。 1512.1更新: 01、PHP更新到64位PHP7.0.1正式版02、Apache更新到64位Apache2.4.1803、增加64位Redis数据缓存服务端

    X:新生命X组件,数据中间件XCode,日志,网络,RPC,序列化,缓存,Windows服务

    新生命基础框架X组件,包括算法、日志、数据库、网络、RPC、序列化、缓存、多线程等模块,支持.NET Framework/.NET Core/Mono/Xamarin 。 2002〜2020,成千上万兄弟姐妹们努力的见证!...支持Apache

    基于 springboot、ant-design-vue 的开源框架+源代码+文档说明

    以Spring Framework为核心容器,Spring data Jpa(Hibernate实现)为数据访问层, Apache Shiro为权限框架,Redis对常用数据进行缓存,前端使用Vue全家桶,前后端分离、JWT鉴权的开源框架。 角色的功能权限控制方式为...

    【YouDianCMS v9.1】 开源五合一建站系统+友点企业网站管理系统+数据自动同步.zip

    源码简介与安装说明: YouDianCMS即友点企业网站管理系统集电脑站+手机站+微信站+APP+小程序五合一,数据自动同步,降低人力维护成本;共用一个管理后台,只要一个虚拟主机,有效节约空间投资。系统采用开源技术...

    基于SpringBoot的企业门户系统源码.zip

    软件架构说明 1、后端 核心框架:Spring Boot 安全框架:Apache Shiro 模板引擎:Thymeleaf 持久层框架:MyBatis 数据库连接池:Alibaba Druid 缓存框架:Ehcache 、Redis 日志管理:SLF4J 工具类:Apache Commons、...

    飞蛙B2B2C商城电商系统 v2.1.8.zip

    封装了CURD和一些常用操作,在安装部署、数据查询、数据缓存、数据验证、模型处理、视图与布局、路由处理、SEO支持、大数据支持等方面表现稳定。 本次升级内容较多,细节就不做阐述,主要修复了阿里云服务器屏蔽25...

    OpenJPA 2.2.1 API (CHM格式)

     OpenJPA 是 Apache 组织提供的开源项目,它实现了 EJB 3.0 中的 JPA 标准,为开发者提供功能强大、使用简单的持久化数据管理框架。OpenJPA 封装了和关系型数据库交互的操作,让开发者把注意力集中在编写业务逻辑上...

    ShopNC【B2B2C】多用户电商平台系统,带WAP,微商城,圈子,门户

    我亲自测试过,没有问题。 包内包含: shopnc b2b2c 商城安装手册.pdf...封装了CURD和一些常用操作,在安装部署、数据查询、数据缓存、数据验证、模型处理、视图与布局、路由处理、SEO支持、大数据支持等方面表现稳定。

    Redis学习手册

    务器宕机,之前在内存中缓存的数据也将全部消失,因此可以看出 memcached 没有提供任何形式的数据 持久化功能,而 Redis 则提供了这样的功能。再有就是 Redis 提供了更为丰富的数据存储结构,如 Hash 和 Set。至于...

    小米手机最新版整站.zip

    4、右上角清理缓存 5、如果网站报/includes/init.php这类的错误说明你空间的PHP版本太低 解决问题办法找到PHP配置文件php.ini,然后查找一项:output_buffering将其值由原来的off改为on,重新启动Apache就可以了。

    基于Java开发的派单管理系统demo源码+项目说明+sql数据库(课程大作业).zip

    5.期待你能在项目中找到乐趣和灵感,也欢迎你的分享和反馈! 【项目介绍】 基于Java开发的派单管理系统demo源码+项目说明+sql数据库(课程大作业).zip **技术选型:** - 核心框架:Spring Boot 1.5 - 安全框架:...

    Apache系列UPUPW PHP7.0正式版1512.1

    特别说明: PHP官方从PHP5.5开始不再支持Windows XP和2003系统,所以PHP7.0不再提供支持。 1512.1更新: 01、PHP更新到PHP7.0.1正式版02、Apache更新到Apache2.4.1803、增加Redis数据缓存服务端04、增加

    finance-master汇尚电子商务商品管理系统.zip

    框架中实现了基本项目骨架,具有用户管理、组织管理、角色管理、模块管理、数据权限、缓存管理、日志管理等。 e.?提供了常用的系统功能,内置1000多个小图标,可自定义上传和带缓存的数据字典。 f.?为了提高UI开发...

    JAVA上百实例源码以及开源项目源代码

     这是个J2ME控制台程序,它能剔除PNG文件中的非关键数据段,减少文件大小从而达到压缩图片的目的。而图片的质量并不会受到损失。使用时候只需在控制台窗口执行jar就可以了。 Java 3DMenu 界面源码 5个目标文件 ...

    基于Springboot+Vue的房价可视化监测系统源码+项目说明.zip

    基于Springboot+Vue的房价可视化监测系统源码+项目说明.zip 【资源说明】 1、该资源内项目代码都是经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、...

    php学习笔记

    apache 34 PHP 36 数据类型 36 一.双引号与单引号 36 二.运算符 36 三.字符串拼接 36 四.类型运算符 36 五.switch语句 36 六.全局变量 37 七.预定义变量 37 函数 39 数组 40 一.用字符串做下标 40 二....

    梦赢开源权限管理系统 v2.0.rar

    3、高效率采用JSON数据与数据缓存方式,大大提高了数据的加载速度 4、稳定性经过大数据测试后,依然稳定运行,系统错误率低 5、安全性权限控制采用后台控制与配置文件控制相结合,双重控制更安全;能精确到用户的...

Global site tag (gtag.js) - Google Analytics