Implement support for If-Modified-Since in GET /orderables and POST /orderables/search

Description

The GET /orderables should support If-Modified-Since HTTP header for all of the incoming requests. If the header is present, the request should only return a whole representation if the server modification date of ANY of the given orderables resources is latter than the date provided in the If-Modified-Since request header https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since if the dates are the same or the version in request header is latter than the server version of all resources, the request will return response code 304 Not Modified and the response body will be empty. Response header Last-Modified should contain the latest modified date of all found resources.

Acceptance criteria:

  • If-Modified-Since request header is supported in GET /orderables endpoint but is optional

  • If the header is not provided, the endpoint returns the response as it used to

  • If the header is provided, the request returns a 200 response with the body only if the server version of ANY of the found resources is latter by comparing the modification dates in the header and the modified date in server resource

  • If the header is provided, but the header version is the same or latter than all of the server modification dates for found orderables, the endpoint returns 304 Not Modified and doesn't attach the request body

  • Last-Modified header should always be present

 

Status

Assignee

Paulina Buzderewicz

Reporter

Sebastian Brudziński

Labels

Story Points

3

Time tracking

36h

Epic Link

Components

Sprint

None

Fix versions

Priority

Major
Configure