last-modified

浏览器缓存和webpack缓存配置

梦想与她 提交于 2019-12-03 09:54:25
本文转载于: 猿2048 网站➞ https://www.mk2048.com/blog/blog.php?id=ia2jca2hcb 浏览器缓存 浏览器缓存分为两种类型: 强缓存 :也称为本地缓存,不向服务器发送请求,直接使用客户端本地缓存数据 协商缓存 :也称304缓存,向服务器发送请求,由服务器判断请求文件是否发生改变。如果未发生改变,则返回304状态码,通知客户端直接使用本地缓存;如果发生改变,则直接返回请求文件。 浏览器缓存机制的过程如下: 强缓存(本地缓存) 强缓存是最彻底的缓存,无需向服务器发送请求,通常用于css、js、图片等静态资源。浏览器发送请求后会先判断本地是否有缓存。如果无缓存,则直接向服务器发送请求;如果有缓存,则判断缓存是否命中强缓存,如果命中则直接使用本地缓存,如果没命中则向服务器发送请求。判断是否命中本地缓存的方法有两种: Expires 和 Cache-Control 。 Expires Expires是http1.0的响应头,代表的含义是资源本地缓存的过期时间,由服务器设定。服务器返回给浏览器的响应头中如果包含Expires字段,浏览器发送请求时拿当前时间和Expires字段值进行比较,判断资源缓存是否失效。如下图所示: Date 代表请求资源的时间, Expires 代表资源缓存的过期时间,可以看到服务器设置资源的缓存时间为5分钟。2017

(Weak) ETags and Last-Modified

£可爱£侵袭症+ 提交于 2019-12-03 07:56:25
问题 As far as I understand the specs, the ETag, which was introduced in RFC 2616 (HTTP/1.1) is a successor (of sorts) for the Last-Modified-Header, which is proposet to give the software-architect more controll over the cache-revalidating process. If both Cache-Validation-Headers (If-None-Match and If-Modified-Since) are present, according to RFC 2616, the client (i.e. the browser) should use the ETag when checking, if a resource has changed. According to section 14.26 of RFC 2616, the server

Etags and last-modified over https SSL?

£可爱£侵袭症+ 提交于 2019-12-03 06:36:44
Is it possible to use HTTP caching for conditional GET requests over a secure HTTPS connection? I've got caching working over non-secure HTTP, but when I switch to HTTPS the browser stops sending if-none-match and if-modified-since headers, so the caching breaks. I've tried various Cache-Control settings like public, max-age=3600 and whatnot, no dice. This happens in both Safari and Chrome, so I'm assuming the SSL is breaking it somehow. Is caching not allowed over SSL? And just to be clear, the server is indeed properly setting the etag and last-modified headers, but the browser is not

mod_rewrite RewriteCond based on Last-modified? (.htaccess)

£可爱£侵袭症+ 提交于 2019-12-03 03:35:25
I know that we can easily base a RewriteCond on any http request header. But can we check (some of) the response headers that are going to be sent? In particular, the Last-modified one? I want to rewrite a url only when the Last-modified date is older than 30 minutes and I'm trying to avoid the overhead of delegating that check to a php file every single time a file from that directory is requested. Thanks in advance! The outbound headers do not exist until much later than mod_rewrite is acting. There also isn't any file-modification-time checking functionality built into mod_rewrite , so the

VBA - How to get the last modified file or folder in a directory in Excel 2010

蓝咒 提交于 2019-12-03 02:40:50
What I want to do is more complex than selecting a file from a list of files. I will start in a directory, then I want to change to the most recently modified directory. I then want to repeat that process in a sub-directory, and then, inside of that, I want to select the most recently modified excel file and open it. What is the best approach to do this? What objects / methods should I be looking into? The simplest function is FileDateTime(pathname) where pathname can be a directory for folder. Alternatively, you can use the FileSystemObject object, DateLastModified property: Dim fileModDate

前端优化

懵懂的女人 提交于 2019-12-03 01:44:06
前言 基本HTML加载,需要 20ms 左右 Nginx配置,关闭 keepalive、etag、gzip、if_modified_since 协议:HTTP/1.1 浏览器:Chrome 减少HTTP请求 加载未合并外部css,需要 35ms 左右 加载合并外部css,需要 25ms 左右 两个合并后的css,加载减少了10ms,如果将页面所有的css、js、图片(CSS sprites )合并,减少的时间将很可观。 DOM以及CSS 上图是浏览器解析HTML和渲染树之间的流程。浏览器在获取到HTML页面后开始解析页面,解析到head标签后,发现外部CSS,会异步发出请求,CSS获取后,解析CSS。 HTML解析后生成DOM Tree,CSS解析后生成CSSOM Tree, 两者结合开始渲染树。 1、首屏的页面要快速的渲染出来,CSS最好放在页面头部。同时有多个css文件的时候,也要将基本样式放在其他样式之前加载(边获取边渲染)。 2、HTML以及CSS的元素层级要尽量少,加快页面渲染。 3、对于首页,可以将基本样式内联放在头部。(快速渲染,灵活应用) JS 上图是浏览器解析流程,蓝色是样式解析,黄色是JS脚本执行,顺序执行。JS脚本执行会阻塞样式或DOM解析 1、JS脚本放在页面下面,防止阻塞页面渲染。 2、不要在JS里执行长时间的程序。 3、减少JS对DOM的操作

Android - HTTP Get - Explicit Termination not called error. What am I missing?

僤鯓⒐⒋嵵緔 提交于 2019-12-02 21:29:18
问题 I am working on a fairly simple android app that should get the last modified/updated date for a webpage but it seems to crash with the following message 05-27 10:50:15.581 2638-2652/android.process.acore E/DictionaryBackupAgent﹕ Couldn't read from the cursor 05-27 10:50:20.658 2638-2647/android.process.acore E/StrictMode﹕ A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. java.lang.Throwable: Explicit

(Weak) ETags and Last-Modified

天大地大妈咪最大 提交于 2019-12-02 20:38:14
As far as I understand the specs, the ETag, which was introduced in RFC 2616 (HTTP/1.1) is a successor (of sorts) for the Last-Modified-Header, which is proposet to give the software-architect more controll over the cache-revalidating process. If both Cache-Validation-Headers (If-None-Match and If-Modified-Since) are present, according to RFC 2616, the client (i.e. the browser) should use the ETag when checking, if a resource has changed. According to section 14.26 of RFC 2616, the server MUST NOT respond with a 304 Not Modified, if the ETag presented in a If-None-Match-Header has changed, and

Android - HTTP Get - Explicit Termination not called error. What am I missing?

别等时光非礼了梦想. 提交于 2019-12-02 11:17:17
I am working on a fairly simple android app that should get the last modified/updated date for a webpage but it seems to crash with the following message 05-27 10:50:15.581 2638-2652/android.process.acore E/DictionaryBackupAgent﹕ Couldn't read from the cursor 05-27 10:50:20.658 2638-2647/android.process.acore E/StrictMode﹕ A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. java.lang.Throwable: Explicit termination method 'close' not called at dalvik.system.CloseGuard.open(CloseGuard.java:184) at android.os

BAT: if statement based on modify date of file

落爺英雄遲暮 提交于 2019-12-02 07:52:05
I want to see if a lock file modify date is more than a 5 seconds ago or it in the future (indicating the PC clock was changed back). How can I say if file.modifydate < now - 5 seconds or modifydate > now run command a (command a will launch my Java app) else run command b (command b will send a UDP packet to a localhost port) Bryan Field As Wimmel suggested, I will be using VBScript - well actually I will be using JScript in the same way VBScript would normally be used... because I am already familiar with JavaScript. I posted this question: Windows XP and Up: JavaScript instead of VBScript?