http last modify时间GMT

169 阅读1分钟

http返回

1、静态资源文件协商缓存 ** 09:17分**GMT时间,

2、但是文件修改的时间明明是17:17分

查了下GMT的含义

GMT(Greenwich Mean Time), 格林威治平时(也称格林威治时间)。

它规定太阳每天经过位于英国伦敦郊区的皇家格林威治天文台的时间为中午12点。

image.png

1、html文件配置 add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; 不强缓存 ssi on; ssi_last_modified on; 开启协商缓存,时间为文件的修改时间GMT时间

2、js、css文件

cachecontrol:max-age:300 5分钟强缓存

etag和modify time也返回了,

//etag是nginx根据md5等算法计算出的,etag的优先级高于modify time

那么静态资源上传cdn之后,可以利用contenthash将不修改的文件缓存(那么不修改的文件是不是设置max-age强缓存很长时间都可以,会有别的问题吗?)