This is the request information. we can see that cache-control has been set successfully. however, a new request is required from the server. the status here should be 200, but the size should be fromcache.
This is the request information. we can see that cache-control has been set successfully.
However, a new request is required from the server.
The status here should be 200, but the size should be from cache.
Reply content:
This is the request information. we can see that cache-control has been set successfully.
However, a new request is required from the server.
The status here should be 200, but the size should be from cache.
See the following example.
time() ){ header("HTTP/1.1 304"); exit; } header("Last-Modified: ".gmdate("D, d M Y H:i:s", time() )." GMT"); echo time(); ?>
Open it in a browser. we can see that the status code 200 is returned for the first time, and the printing time is the latest time. Then we opened it for the second time. we can see that the status code is 304, and the time is the same as the previous time, indicating that we are using the cache. We delete the last_modified.php file, and then open the page for the third time. the browser returns error 404. it can be seen that although Last-Modified uses the cache, each time you open the page, you still need to initiate an http request to the server, the browser determines whether the browser content expires based on the user's $ _ SERVER ['http _ IF_MODIFIED_SINCE ']. if the browser content does not expire, the browser returns the 304 status and the browser content is read from the cache.