diff --git a/md-query.robot b/md-query.robot index 8a2b21e..64f73c3 100644 --- a/md-query.robot +++ b/md-query.robot @@ -51,7 +51,27 @@ Variables variables.py ${resp}= Conditional Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED} etag=${etag} Should Be Equal As Strings ${resp.status_code} 304 msg=SHOULD return HTTP status code 304 -# 4.2 Content Caching +4.2 Content Caching + [Tags] optional + # "Responders SHOULD include cache control information with successful + # (200 status code) responses, assuming the responder knows when + # retrieved metadata is meant to expire." + ${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED} + Should Be Equal As Strings ${resp.status_code} 200 + Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header with Success response + # "When cache controls are used only the 'max-age' directive SHOULD be used." + ${directive}= Get From Dictionary ${resp.headers} cache-control + Should Start With ${directive} max-age= msg=Only the 'max-age' directive SHOULD be used + + # "The responder SHOULD also include cache control information with 404 Not + # Found responses. This allows the requester to create and maintain a + # negative-response cache." + ${resp}= Get Entity baseUrl=${BASE_URL} identifier=foo + Should Be Equal As Strings ${resp.status_code} 404 + Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header with Not Found response + # "When cache controls are used only the 'max-age' directive SHOULD be used." + ${directive}= Get From Dictionary ${resp.headers} cache-control + Should Start With ${directive} max-age= msg=Only the 'max-age' directive SHOULD be used 4.3 Content Compression ${resp}= Get Entity With Gzip baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}