CS FundamentalsHardProduct-company placement · web
A shared cache stores a response from origin that carries Vary: Accept-Encoding. A later client asks for the same URL with a different Accept-Encoding value. What should the cache do?
- A. Serve the stored copy, because the URL alone is the cache key
- B. Serve the stored copy and add a Warning header naming the encoding difference
- C. Recompress the stored body into the new encoding and then serve it
- D. Treat it as a miss unless it holds a variant stored for that Accept-Encoding
Correct answer: D. Treat it as a miss unless it holds a variant stored for that Accept-Encoding
Vary makes the listed request headers part of the cache key, so a gzip variant must not be served to a client that asked for identity or br. Ignoring Vary is a classic cause of browsers getting compressed bytes they cannot decode.
More Computer Networks questions
- A site's A record has a TTL of 86,400 s. The team will move the site to a new IP at 10:00 on Friday and wants every cache to pick up the…
- A bank sends Strict-Transport-Security: max-age=31536000 and is not on any browser's HSTS preload list. Which statement is correct?
- A bitmap image is encrypted with AES, and the ciphertext still shows the outline of the picture. Which mode of operation was used, and why?
- A developer encrypts two different messages with the same one-time-pad key K: C1 = M1 ⊕ K and C2 = M2 ⊕ K. What can an eavesdropper…
- A layer-2 switch carries an IPTV multicast stream. Without any special feature it floods the stream to every port in the VLAN. Which…
- An AS with two upstream ISPs wants inbound traffic to prefer ISP A, so it advertises its prefix to ISP B with its own AS number repeated…