Complete the code to check if the client's ETag matches the server's ETag.
if request.headers.get('If-None-Match') == [1]: return '', 304
The server compares the client's If-None-Match header with its own server_etag to decide if the resource has changed.
Complete the code to set the ETag header in the server's response.
response.headers['ETag'] = [1]
The server sets the ETag header to its current resource version server_etag so clients can cache it.
Fix the error in the code that returns a 304 response when ETags match.
if request.headers.get('If-None-Match') == [1]: return '', 304
The code should return a 304 status code (Not Modified) when the ETags match, not 200.
Fill both blanks to create a dictionary comprehension that maps resource IDs to their ETags only if the ETag length is greater than 10.
etag_map = {resource_id: [1] for resource_id, [2] in resources.items() if len(etag) > 10}The comprehension maps resource_id to etag for each resource where the ETag length is greater than 10.
Fill all three blanks to create a dictionary comprehension that maps uppercase resource IDs to their ETags only if the ETag starts with 'W/'.
etag_map = { [1]: [2] for resource_id, etag in resources.items() if etag.[3]('W/') }endswith instead of startswith.The comprehension maps uppercase resource_id to etag only if the ETag starts with 'W/'.