max-age

Can a user agent set a max-age greater than zero in its request?

半腔热情 提交于 2021-02-18 23:00:17
问题 I have a doubt about max-age behaviour after reading the Http Cache rfc. Scenario: User agent GET /foo Origin Server Response header cache-control: max-age=120 Server tells user agent that the resource requested should be revalidated after 2 minutes. After 1 minute and few seconds, User agent makes another request, specifying a max-age of 1 minute: User agent cache-control: max-age=60 GET /foo From what I understand, this request should bypass the user agent cache. Why? Although the Origin

如何设置max-age或expires来缓存您的站点文件

廉价感情. 提交于 2020-01-07 07:42:58
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 方法: <meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Expires" content="Mon, 20 Jul 2009 23:00:00 GMT" /> 详情: Cache-control用于控制HTTP缓存(在HTTP/1.0中可能部分没实现,仅仅实现了Pragma: no-cache) 数据包中的格式: Cache-Control: cache-directive cache-directive可以为以下: request时用到: | "no-cache" | "no-store" | "max-age" "=" delta-seconds | "max-stale" [ "=" delta-seconds ] | "min-fresh" "=" delta-seconds | "no-transform" | "only-if-cached" | "cache-extension" response时用到: | "public" | "private" [ "=" <"> field-name <"> ] | "no-cache" [ "=" <"> field-name <"> ] | "no