[Excerpt] header parameter description

Source: Internet
Author: User
Tags ranges

PHP header cache-header parameter description]
1. Accept: indicates the media type that the Web Server accepts. */* indicates any type, and type/* indicates all child types of the type, type/sub-type.

2. Accept-charset: the browser declares the character set it receives.
Accept-encoding: indicates the encoding method received by the browser. It usually specifies the compression method, whether compression is supported, and what compression method (gzip, deflate) is supported)
Accept-language: indicates the language your browser receives.
Differences between a language and a character set: Chinese is a language, and Chinese has multiple character sets, such as big5, gb2312, and GBK.

3. Accept-ranges: indicates whether the Web Server accepts a request to obtain a part of an object (such as a part of a file.
Bytes: Accept, none: not accept.

4. Age: When the contemporary server uses its own cached entities to respond to requests, it uses this header to indicate how long the entity has elapsed since it was generated.

5. Authorization: when the client receives the WWW-authenticate response from the Web server, it uses this header to respond to its authentication information to the web server.

6. cache-control: Request: No-Cache (the entity that is not cached must be retrieved from the Web server now)
MAX-age: (only objects whose age value is smaller than the max-age value and no expiration date are accepted)
MAX-stale: (can accept previous objects, but the expiration time must be less than the max-stale value)
Min-fresh: (accept the cache object whose fresh life cycle is greater than the sum of the current age and Min-fresh values)
response: Public (you can use cached content to respond to any user)
private (the user who can only respond to the previously requested content with the cached content)
NO-Cache (it can be cached, but it can only be returned to the client after being validated with the Web server)
MAX-age: (expiration time of the object contained in this response)
all: no-store (Cache not allowed)

7. Connection: Request: Close (tell the Web server or proxy server to disconnect the connection after the response of this request is completed. Do not wait for subsequent requests of this connection ).
Keepalive (tell the Web server or proxy server to keep the connection after the response of this request is completed and wait for subsequent requests of this connection ).
Response: Close (the connection has been closed ).
Keepalive (the connection remains, waiting for subsequent requests from this connection ).
Keep-alive: If the browser requests to keep the connection, the header indicates how long (in seconds) The web server wants to keep the connection ).
Example: keep-alive: 300

8. Content-encoding: indicates the compression method (gzip and deflate) used by the Web server to compress the objects in the response.
Example: Content-encoding: Gzip
Content-language: the language of the object that the Web server tells the browser to respond.

Content-Length: the length of the object that the Web server tells the browser to respond.
example: Content-Length: 26012
content-range: the Web server indicates the part of the entire object contained in the response.
example: Content-range: bytes 21010-47021/47022
content-type: the type of the object that the Web server tells the browser to respond.
example: Content-Type: Application/XML

9. etag: it is the flag value of an object (such as a URL). For an object, such as an HTML file, if it is modified, its etag will not be modified,
Therefore, the role of etag is similar to that of last-modified, mainly for the Web server to determine whether an object has changed.
For example, if the etag of an HTML file is obtained in the previous request, when the file is requested again, the browser will send the previously obtained etag value
On the web server, the web server compares the etag with the current etag of the file, and then knows whether the file has changed.

10. Expired: the Web server indicates when the object will expire. expired objects can be used to respond to customer requests only after they are verified with the Web server.
Is the header of HTTP/1.0.
Example: expires: sat, 23 May 2009 10:02:12 GMT

11. HOST: Specifies the domain name/IP address and port number of the Web server you want to access.
Example: Host: rss.sina.com.cn

12. If-Match: if the object's etag does not change, it means that the object has not changed before the request action is executed.
If-None-Match: If the etag of the object changes, the request action is executed only when the object changes.

13. If-modified-since: if the requested object is modified after the time specified in the header, the requested action (such as the returned object) is executed; otherwise, the request is returned.Code304, telling the browser that the object has not been modified.
Example: If-modified-since: Thu, 10 Apr 2008 09:14:42 GMT
If-unmodified-since: if the requested object has not been modified after the time specified in the header, the requested action (such as the returned object) is executed ).

14. If-range: the browser tells the web server that if the requested object does not change, it will give me the part I lack. If the object changes, it will give me the entire object.
The browser sends the request object's etag or the last modification time it knows to the Web server to determine whether the object has changed.
Always used with the range header.

15. Last-modified: The last modification time of the object, for example, the last modification time of the file, and the last generation time of the dynamic page.
Example: Last-modified: Tue, 06 May 2008 02:42:43 GMT

16. Location: the Web server tells the browser that the object to be accessed has been moved to another location and retrieved from the specified position in the header.
Example: location:

17. pramga: mainly uses pramga: No-cache, which is equivalent to cache-control: No-cache.
Example: Pragma: No-Cache

18. Proxy-Authenticate: the proxy server responds to the browser and requires it to provide Proxy authentication information.
Proxy-Authorization: the browser responds to the proxy server's authentication request and provides its own identity information.

19. Range: When a browser (such as flash get multi-thread download) tells the web server which part of the object it wants.
Example: range: bytes = 1173546-

20. Referer: indicates to the Web server from which the browser obtains/clicks the URL/URL in the current request.
Example: Referer:Http://www.sina.com/

21. SERVER: indicates the software and version of the web server.
Example: SERVER: Apache/2.0.61 (UNIX)

22. User-Agent: indicates the identity of the browser (which browser is used ).
Example: User-Agent: Mozilla/5.0 (windows; U; Windows NT 5.1; ZH-CN; RV: 1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

23. Transfer-encoding: the Web server indicates the encoding of the Response Message Body (not an object in the message body), such as chunked ).
Example: Transfer-encoding: chunked

24. vary: the Web server uses the content in this header to inform the cache server of the conditions under which the returned object can be used to respond to subsequent requests.
If the source web server receives the first request message, its response header is content-encoding: gzip; vary: Content-encoding.
The cache server analyzes the header of the subsequent request message and checks whether the accept-encoding value is consistent with the vary header value of the previous response, that is, whether to use
The same content encoding method can prevent the cache server from using the compressed entity responses in its own cache to Browsers without decompression capabilities.
Example: vary: Accept-Encoding

25. Via: list the proxy servers through which the responses from the client to the OCs or in the opposite direction are sent, and the Protocol (and version) they use.
When a client request arrives at the first proxy server, the server adds the via header to the request and fills in its own information. When the next Proxy Server
When receiving the request from the first proxy server, it will copy the via header of the request from the previous proxy server in its own request and add its own information to the back,
Similarly, when OCs receives the request from the last proxy server, it checks the via header to know the route through which the request is routed.
Example: via: 1.0 236-81.d07071953.sina.com.cn: 80 (squid/2.6.stable13)

========================================================== ========================================================== ========================================================== ====
Example of the HTTP request message header:
HOST: rss.sina.com.cn
User-Agent: Mozilla/5.0 (windows; U; Windows NT 5.1; ZH-CN; RV: 1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/XML, application/XML, application/XHTML + XML, text/html; q = 0.9, text/plain; q = 0.8, image/PNG ,*/*; Q = 0.5
Accept-language: ZH-CN, ZH; q = 0.5
Accept-encoding: gzip, deflate
Accept-charset: gb2312, UTF-8; q = 0.7, *; q = 0.7
Keep-alive: 300
Connection: keep-alive
COOKIE: userid = c5bypxrimdmsiqmsbpne1vn8zqmdwsm3wrleb3vrwtnrtw <-- cookie
If-modified-since: Sun, 01 Jun 2008 12:05:30 GMT
Cache-control: Max-age = 0

HTTP Response Message Header instance:
Status: OK-200 <-- response status code, indicating the Web server processing result.
Date: Sun, 01 Jun 2008 12:35:47 GMT
Server: Apache/2.0.61 (UNIX)
Last-modified: Sun, 01 Jun 2008 12:35:30 GMT
Accept-ranges: bytes
Content-Length: 18616
Cache-control: Max-age = 120
Expires: Sun, 01 Jun 2008 12:37:47 GMT
Content-Type: Application/XML
Age: 2
X-Cache: hit from 236-41.d07071951.sina.com.cn <-- the HTTP header used by the reverse proxy server
By: 1.0 236-41.d07071951.sina.com.cn: 80 (squid/2.6.stable13)
Connection: Close

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.