使用e-tag来加快页面加载速度和提高用户体验
2012-04-20 13:58
633 查看
I use the Firefox plugin Tamper Data 10.0.1 to trace the http
If we open the website http://10.242.224.69:8080/estore/ and activate the tamper data plugin.
We can see that:
We can see that If-None-Match=02e81f8533137e20549e917d7122ec ,which means that If the etag equals to this one ,then the server will think that “the client has cached the resource ,so it returns 304
See from the right column . In http protocol : 304 means that
So ,since the server returns 304 ,then the server will not contains any response content ,which reduces the bandwidth.. ->see from the right column ,the response is “Not Modified-304”
That’s why I suggest that we can add e-tag to most elements to accelerate the loading speed and enhance the user experience.
If we open the website http://10.242.224.69:8080/estore/ and activate the tamper data plugin.
We can see that:
We can see that If-None-Match=02e81f8533137e20549e917d7122ec ,which means that If the etag equals to this one ,then the server will think that “the client has cached the resource ,so it returns 304
See from the right column . In http protocol : 304 means that
If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code. The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields. The response MUST include the following header fields: - Date, unless its omission is required by section 14.18.1 If a clockless origin server obeys these rules, and proxies and clients add their own Date to any response received without one (as already specified by [RFC 2068], section 14.19), caches will operate correctly. - ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request - Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same variant If the conditional GET used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers. If a 304 response indicates an entity not currently cached, then the cache MUST disregard the response and repeat the request without the conditional. If a cache uses a received 304 response to update a cache entry, the cache MUST update the entry to reflect any new field values given in the response.
So ,since the server returns 304 ,then the server will not contains any response content ,which reduces the bandwidth.. ->see from the right column ,the response is “Not Modified-304”
That’s why I suggest that we can add e-tag to most elements to accelerate the loading speed and enhance the user experience.
相关文章推荐
- 【转】使用jquery实现图片预加载提高页面加载速度和用户体验
- 【华磊原创】-提高用户体验?衡量页面加载速度的几个关键指标。
- 【华磊原创】-提高用户体验?衡量页面加载速度的几个关键指标。
- 加快activity显示速度,提高用户体验
- 给程序增加一个加载页面,提高用户体验
- 加快activity显示速度,提高用户体验
- 加快页面加载速度的解决方案-asp.net使用httphandler打包多CSS或JS文件
- 页面加载时,添加进度条,提高用户体验
- asp.net使用httphandler打包多CSS或JS文件以加快页面加载速度
- 加快activity显示速度,提高用户体验
- Android 使用简单又方便的SharedPreferences让导航页面只进入一次 , 提高用户对app的体验度
- 使用异步页面,后台线程提高用户体验和服务器端性能
- asp.net使用httphandler打包多CSS或JS文件以加快页面加载速度
- AngularJs在使用路由时采用ocLazyLoad进行按需加载提高页面加载速度
- asp.net使用httphandler打包多CSS或JS文件以加快页面加载速度
- 六招帮你提高网页的加载速度 改善用户体验
- asp.net使用httphandler打包多CSS或JS文件以加快页面加载速度
- asp.net使用httphandler打包多CSS或JS文件以加快页面加载速度
- 如何加快HTML页面加载速度
- 前端如何实现图片懒加载(lazyload) 提高用户体验