How “304 Not Modified” works?
问题 How \"304 Not Modified\" is generated? How does a browser determine whether the response to a http request is 304? Is it set by the browser or sent from the server? If sent by server, how does server know the data available in cache, also how does it set 304 to an image? My guess, if generated by browser function is_modified() { return get_data_from_cache() === get_data_from_url(); }; function get_data_from_cache() { return some_hash_or_xxx_function(cache_data); } function get_data_from_url()