我有一个AJAX应用程序,其设置如下:
有两种动态内容:
我采取以下步骤:
静态内容以及组合体处理程序生成的内容都有cache-control头,而后者也有过期标头。
我预计第一次刷新将加载所有资源,但第二次只是真正的动态内容。即使如此,也不会返回任何内容,因为没有修改任何内容。
实际上,浏览器加载更多的资源,然后它就应该加载资源。
请在下面找到第一次刷新后浏览器所做请求的摘要(组合式urls非常长,因此为了清楚起见,我截断了它们):
# Result Protocol Host URL Body Caching Content-Type Process
1 200 HTTP localhost:8000 / 14,348 text/html; charset=utf-8 chrome:3852
2 200 HTTP localhost:8000 /combo?yui/cssreset/cssreset-min.css&yui/cssfonts/cssfonts-min.css 638 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:49 GMT text/css; charset=utf-8 chrome:3852
3 200 HTTP localhost:8080 /if/admin.min.css 22,176 public,max-age=31536000 text/css chrome:3852
4 200 HTTP localhost:8080 /yui/yui/yui-min.js 25,586 public,max-age=31536000 application/javascript chrome:3852
5 200 HTTP localhost:8080 /if/admin.min.js 37,889 public,max-age=31536000 application/javascript chrome:3852
6 200 HTTP localhost:8000 /combo?yui/cssgrids/cssgrids-min.css&yui/widget-base/assets/skins/sam/widget-base.css&... 6,223 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:49 GMT text/css; charset=utf-8 chrome:3852
7 200 HTTP localhost:8000 /combo?yui/oop/oop-min.js&yui/attribute-core/attribute-core-min.js&... 97,019 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:49 GMT application/javascript; charset=utf-8 chrome:3852
8 200 HTTP localhost:8000 /combo?yui/dataschema-json/dataschema-json-min.js&yui/dataschema-xml/dataschema-xml-min.js&... 46,248 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:50 GMT application/javascript; charset=utf-8 chrome:3852
9 200 HTTP localhost:8000 /combo?yui-gallery/gallery-querybuilder/assets/skins/sam/gallery-querybuilder.css&... 872 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:51 GMT text/css; charset=utf-8 chrome:3852
10 200 HTTP localhost:8000 /combo?yui-gallery/gallery-formmgr/gallery-formmgr-min.js&... 4,627 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:51 GMT application/javascript; charset=utf-8 chrome:3852
11 200 HTTP localhost:8000 /combo?yui-gallery/gallery-node-optimizations/gallery-node-optimizations-min.js&... 2,269 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:51 GMT application/javascript; charset=utf-8 chrome:3852
12 200 HTTP localhost:8000 /combo?yui/substitute/substitute-min.js 1,006 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:15:51 GMT application/javascript; charset=utf-8 chrome:3852
13 200 HTTP localhost:8000 /api/context 81,238 application/json; charset=utf-8 chrome:3852
14 200 HTTP localhost:8080 /yui/assets/skins/sam/sprite.png 2,913 public,max-age=31536000 image/png chrome:3852
15 200 HTTP localhost:8080 /yui/node-menunav/assets/skins/sam/horizontal-menu-submenu-indicator.png 157 public,max-age=31536000 image/png chrome:3852 备注:
下面是这个摘要在第二次刷新之后的样子:
# Result Protocol Host URL Body Caching Content-Type Process
1 304 HTTP localhost:8000 / 0 chrome:3852
2 304 HTTP localhost:8000 /combo?yui/cssreset/cssreset-min.css&yui/cssfonts/cssfonts-min.css 0 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:38:55 GMT chrome:3852
3 304 HTTP localhost:8080 /if/admin.min.css 0 chrome:3852
4 304 HTTP localhost:8080 /yui/yui/yui-min.js 0 chrome:3852
5 304 HTTP localhost:8080 /if/admin.min.js 0 chrome:3852
6 304 HTTP localhost:8000 /combo?yui/cssgrids/cssgrids-min.css&yui/widget-base/assets/skins/sam/widget-base.css&... 0 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:38:55 GMT chrome:3852
7 304 HTTP localhost:8000 /combo?yui/oop/oop-min.js&yui/attribute-core/attribute-core-min.js&... 0 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:38:55 GMT chrome:3852
8 304 HTTP localhost:8000 /combo?yui/dataschema-json/dataschema-json-min.js&yui/dataschema-xml/dataschema-xml-min.js&... 0 public,max-age=31536000; Expires: Fri, 16 Jan 2015 02:38:56 GMT chrome:3852
9 304 HTTP localhost:8000 /api/context 0 chrome:3852 注意,第一个摘要中的请求9-12、14和15的URL不在第二个摘要中--浏览器缓存它们。但是,为什么浏览器不缓存请求2-8(从第一个摘要中),这些请求似乎具有与缓存的请求相同的特性?
附录A
请在下面找到第一次刷新后所有请求和响应的完整标题(我使用了一个新的会话,因此日期与上面提供的简短摘要不同):
GET / HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Content-Type: text/html; charset=utf-8
ETag: "-1836563736"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:55 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /combo?yui/cssreset/cssreset-min.css&yui/cssfonts/cssfonts-min.css HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: text/css,*/*;q=0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Tue, 23 Apr 2013 23:46:18 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:55 GMT
Content-Type: text/css; charset=utf-8
ETag: "-1463284566"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:55 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /yui/yui/yui-min.js HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: application/javascript
Accept-Ranges: bytes
Cache-Control: public,max-age=31536000
Last-Modified: Tue, 14 Jan 2014 11:59:00 GMT
ETag: W/"4gIxoOsipQY4gIw4Hu8s3Y"
Content-Length: 25586
Server: Jetty(9.1.0.v20131115)
---
GET /if/admin.min.css HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/css,*/*;q=0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/css
Accept-Ranges: bytes
Cache-Control: public,max-age=31536000
Last-Modified: Tue, 14 Jan 2014 11:59:00 GMT
ETag: W/"vSW0rAEe/b8vSW17JGA3h4"
Content-Length: 22176
Server: Jetty(9.1.0.v20131115)
---
GET /if/admin.min.js HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: application/javascript
Accept-Ranges: bytes
Cache-Control: public,max-age=31536000
Last-Modified: Tue, 14 Jan 2014 11:59:00 GMT
ETag: W/"7VPNTHzTc387VPMDOxNk7k"
Content-Length: 37889
Server: Jetty(9.1.0.v20131115)
---
GET /combo?yui/cssgrids/cssgrids-min.css&yui/widget-base/assets/skins/sam/widget-base.css&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: text/css,*/*;q=0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Tue, 23 Apr 2013 23:46:22 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:55 GMT
Content-Type: text/css; charset=utf-8
ETag: "1986623550"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:55 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /combo?yui/oop/oop-min.js&yui/attribute-core/attribute-core-min.js&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Thu, 02 May 2013 22:59:53 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:55 GMT
Content-Type: application/javascript; charset=utf-8
ETag: "1918884200"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:55 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /combo?yui/dataschema-json/dataschema-json-min.js&yui/dataschema-xml/dataschema-xml-min.js&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Tue, 23 Apr 2013 23:46:24 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:56 GMT
Content-Type: application/javascript; charset=utf-8
ETag: "1381642784"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:56 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /combo?yui-gallery/gallery-querybuilder/assets/skins/sam/gallery-querybuilder.css&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Authorization: Basic YWRtaW46MTIz
Accept: text/css,*/*;q=0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Thu, 02 May 2013 22:59:53 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:56 GMT
Content-Type: text/css; charset=utf-8
Content-Length: 872
Date: Thu, 16 Jan 2014 02:53:56 GMT
Connection: keep-alive
---
GET /combo?yui-gallery/gallery-formmgr/gallery-formmgr-min.js&yui-gallery/gallery-overlay-extras/gallery-overlay-extras-min.js HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Authorization: Basic YWRtaW46MTIz
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Thu, 02 May 2013 22:59:53 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:56 GMT
Content-Type: application/javascript; charset=utf-8
ETag: "264489472"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:56 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /combo?yui-gallery/gallery-node-optimizations/gallery-node-optimizations-min.js&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Authorization: Basic YWRtaW46MTIz
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Thu, 02 May 2013 22:59:53 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:56 GMT
Content-Type: application/javascript; charset=utf-8
ETag: "946735146"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:56 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /combo?yui/substitute/substitute-min.js HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Authorization: Basic YWRtaW46MTIz
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Tue, 23 Apr 2013 23:46:22 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 02:53:56 GMT
Content-Type: application/javascript; charset=utf-8
Content-Length: 1006
Date: Thu, 16 Jan 2014 02:53:56 GMT
Connection: keep-alive
---
GET /api/context HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Authorization: Basic YWRtaW46MTIz
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
X-Requested-With: XMLHttpRequest
Accept: */*
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "1217632044"
Content-Encoding: gzip
Date: Thu, 16 Jan 2014 02:53:56 GMT
Connection: keep-alive
Transfer-Encoding: chunked
---
GET /yui/assets/skins/sam/sprite.png HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Accept: image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: public,max-age=31536000
Content-Type: image/png
Last-Modified: Tue, 23 Apr 2013 23:46:18 GMT
ETag: W/"oHo6+Hf6zcMoHo7xE6wr7I"
Content-Length: 2913
Server: Jetty(9.1.0.v20131115)
---
GET /yui/node-menunav/assets/skins/sam/horizontal-menu-submenu-indicator.png HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Accept: image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: public,max-age=31536000
Content-Type: image/png
Last-Modified: Tue, 23 Apr 2013 23:46:20 GMT
ETag: W/"jvhF7Fl3QdUjvhE0GA9Mag"
Content-Length: 157
Server: Jetty(9.1.0.v20131115)
---附录B
请在下面找到第二次刷新后所有请求和响应的完整标题(我使用了一个新的会话,因此日期与上面提供的简短摘要不同):
GET / HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
If-None-Match: "-1836563736"
HTTP/1.1 304 Not Modified
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
ETag: "-1836563736"
Date: Thu, 16 Jan 2014 03:03:44 GMT
Connection: keep-alive
---
GET /combo?yui/cssreset/cssreset-min.css&yui/cssfonts/cssfonts-min.css HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: text/css,*/*;q=0.1
If-None-Match: "-1463284566"
If-Modified-Since: Tue, 23 Apr 2013 23:46:18 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 304 Not Modified
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Tue, 23 Apr 2013 23:46:18 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 03:03:44 GMT
ETag: "-1463284566"
Date: Thu, 16 Jan 2014 03:03:44 GMT
Connection: keep-alive
---
GET /if/admin.min.css HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/css,*/*;q=0.1
If-None-Match: W/"vSW0rAEe/b8vSW17JGA3h4"
If-Modified-Since: Tue, 14 Jan 2014 11:59:00 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 304 Not Modified
Vary: Accept-Encoding
ETag: W/"vSW0rAEe/b8vSW17JGA3h4"
Server: Jetty(9.1.0.v20131115)
---
GET /yui/yui/yui-min.js HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
If-None-Match: W/"4gIxoOsipQY4gIw4Hu8s3Y"
If-Modified-Since: Tue, 14 Jan 2014 11:59:00 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 304 Not Modified
Vary: Accept-Encoding
ETag: W/"4gIxoOsipQY4gIw4Hu8s3Y"
Server: Jetty(9.1.0.v20131115)
---
GET /if/admin.min.js HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
If-None-Match: W/"7VPNTHzTc387VPMDOxNk7k"
If-Modified-Since: Tue, 14 Jan 2014 11:59:00 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 304 Not Modified
Vary: Accept-Encoding
ETag: W/"7VPNTHzTc387VPMDOxNk7k"
Server: Jetty(9.1.0.v20131115)
---
GET /combo?yui/cssgrids/cssgrids-min.css&yui/widget-base/assets/skins/sam/widget-base.css&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: text/css,*/*;q=0.1
If-None-Match: "1986623550"
If-Modified-Since: Tue, 23 Apr 2013 23:46:22 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 304 Not Modified
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Tue, 23 Apr 2013 23:46:22 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 03:03:44 GMT
ETag: "1986623550"
Date: Thu, 16 Jan 2014 03:03:44 GMT
Connection: keep-alive
---
GET /combo?yui/oop/oop-min.js&yui/attribute-core/attribute-core-min.js&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: */*
If-None-Match: "1918884200"
If-Modified-Since: Thu, 02 May 2013 22:59:53 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 304 Not Modified
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Thu, 02 May 2013 22:59:53 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 03:03:44 GMT
ETag: "1918884200"
Date: Thu, 16 Jan 2014 03:03:44 GMT
Connection: keep-alive
---
GET /combo?yui/dataschema-json/dataschema-json-min.js&yui/dataschema-xml/dataschema-xml-min.js&... HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic YWRtaW46MTIz
Accept: */*
If-None-Match: "1381642784"
If-Modified-Since: Tue, 23 Apr 2013 23:46:24 GMT
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 304 Not Modified
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
Last-Modified: Tue, 23 Apr 2013 23:46:24 GMT
Cache-Control: public,max-age=31536000
Expires: Fri, 16 Jan 2015 03:03:45 GMT
ETag: "1381642784"
Date: Thu, 16 Jan 2014 03:03:45 GMT
Connection: keep-alive
---
GET /api/context HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Authorization: Basic YWRtaW46MTIz
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
X-Requested-With: XMLHttpRequest
Accept: */*
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
If-None-Match: "1217632044"
HTTP/1.1 304 Not Modified
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
Vary: Accept-Encoding
ETag: "1217632044"
Date: Thu, 16 Jan 2014 03:03:46 GMT
Connection: keep-alive
---编辑
我之所以提到Chrome,是因为这是我使用的浏览器。其他浏览器的行为可能会有所不同,现在我对Chrome特别感兴趣。
发布于 2014-05-07 03:01:43
它确实缓存了它们,但是只要您按下刷新按钮,它就会强制对所有资源进行重新验证。您将注意到,它发送了If-None-Match和If-Modified-Since头,以便服务器能够有条件地响应,而服务器发送回304,表示缓存的副本仍然是新鲜的。我不知道为什么有些资源没有被重新验证。
如果您想在不重新验证的情况下执行“重新加载”,只需选择URL栏并按enter键即可。
https://stackoverflow.com/questions/21152518
复制相似问题