Request part of HTTPBasic structure
Request Line get/test/hello.html http/1.1 header (not every request) empty line content (content name = Content body)
Common message Headers (detailed HTTP request message headers)
accept:text/html,image/* (Tell server, browser can accept text, Web page picture) Accept-charaset:iso-8859-1 [Accept character encoding: Iso-8859-1] accept-encoding: Gzip,compress[can accept gzip,compress compressed data] accept-language:zh-cn[Browser supported language host:localhost:8080[browser to find the host] If-modif Ied-since:tue,11jul 2000 18:23:51[told the server I have this file in the cache, the time of the file is ...] Referer:http://localhost:8080/test/abc.html[told the server where I came from, often used to prevent downloads, hotlinking] user-agent:nozilla/4.0 (Com ...) [Tell the server my browser kernel] cookie:connection:close/keep-alive [Keep link, post data, I do not close link] date:[browser send data request time]
Request method: Post,get,head,delete,put,trace,
Get commit, transfer data size is about 2K (ie browser only)
Post submission, preferably at 64k or it will affect performance
HTTP response InformationResponse header Information
location:http://www.baidu.org/index.jsp Server:apache Tomcat [told browser I was Tomcat] Content-encoding:gzip[told the browser I used gzip ] content-lenght:80 [Tell browser loopback data size] content-language:zh-cn[support Chinese] content-type:text/html;charset=gb2312[content format and Encoding] last-modified:tue,11 juj,2000 18 18:29:20[tells the browser what time the resource was last updated] refresh:1;url=http://www.baidu.com[How long did the brush New where to go] content-disposition;attachment;filename=aaa.zip[told the browser to have file download] transfer-encoding:chunked[transmission Code] Set-cook Ie:expires:-1[tells the browser how to cache pages] Cache-control:[tells the browser how to cache the page (because browser compatibility is best set two)] Pragma:no-cache CONNECTION:CL Ose/keep-alive date:tue,11 June 2000 18:23:51
(1) Some sites are relatively high in timeliness, we do not cache the page
Response.setdateheader ("Expires",-1);
To ensure compatibility
Response.setheader ("Cache-control", "No-cache")
Response.setheader ("Pragma", "No-cache")
(2) Some Web sites require Web pages to cache a certain amount of time, such as caching one hours
Response.setdateheader ("Expires", System.currentimemillis () *3600*1000*24);
General Information Header
Cache-control:no-cache
Pragma:no-cache
Connection:close/keep-alive
Date: Time