html - Should HTTP 304 Not Modified-responses contain cache-control headers? -
I have tried to understand it, and have searched SO for similar questions, but I still have 100% Do not understand
Response header server Apache-Coyote / 1.1 Date Mon, 19 Oct 2009 09:04:04 GMT End Mon, 19 Oct 2009 09:06:05 GMT Share this: , Maximum age = 120 etag image_a70703fb393a60b6da346c112715a0abd54a3236 content-dispersion inline; File name = "binary-216-420" content-type image / jpg; Charset = UTF-8 content-length 4719
The desired behavior is that the customer should cache it for 120 seconds, then request it again to the server within 120 seconds, the server No request is sent on.
Then, after 120 seconds, a request is sent and a 304 response is received:
Response headers server Apache-Coyote / 1.1 Date Mon, 19 October 2009 09:06:13 GMT Request header host localhost: 8080 User-agent Mozilla / 5.0 (Macintosh; U. Intel Mac OS X 10.5; N-US; RV .: 1.9.1.3) Gecko / 20090824 Firefox / 3.5 .3 image / png, image / *; Q = 0.8, * / *; Q = 0.5 Accept language-N-us, no; Q = 0.8, square; Q = 0.7, n; Q = 0.5, sv; Q = 0.3, nn; Q = 0.2 Accept-encoding gzip, deflate Accept-Charset ISO-8859-1, UTF-8; Q = 0.7, *; Keep Q = 0.7- Keep 300 connections alive-alive Referer http: // localhost: 8080 / cm / site / 0 / n / home cookie JSESSIONID = 768ABBE1A3BFABE3B535900233330650; VersionsCssDisplayState = section; IceInfo = iceOn: false, active portlet:, IcePage PanelX: 1722, IcePage Panilai: 3 If -No Any-match Image_A70703fb393a60b6da346c112715a0abd54a3236
So far, all well. But then, on the next request (whithin in 120 seconds) I would have thought that the resource should be cached for 120 new seconds, on the other side what I am seeing in Firefox (Firefox), it always requests processing from this point And receives 304-response.
Do I have 304-response to the cache-control header? Can I read in the imagery, it seems that the cache-control settings should be omitted and the cache should automatically cache for 120 new seconds? In principle you should not need to send cash-control to 304 - the recipient should be just right -
Continue to use the cash instructions that it received from the original 200. However, as you have found, if you do not send cash-control, then those browsers will ignore the cash instructions sent by you, and will return them to their default hurricanes.
In practice, you should include the same cash-control with a 304, which you will do with 200. The device is only a mandate that you send it to 304 if it is different from yours
and to respond specifically to the wrong points of the other answer (structure):
-
You want an intermediary cache to cache the do (i.e. update their cache entry for processing). They will respond appropriately to requests with customers with 200 or 304, depending on whether the conditional headers in the client-like-modified-to.
-
120-second TTL will will be refreshing till 304 (hence the same customer will have the same resource for at least another 120 seconds Other requests should not be made). And the client will continue to make a conditional request to the resource, as long as they still receive cached content, will continue to respond to the resource, which you can continue to answer with 304.
Comments
Post a Comment