I am new to working with the Rest API in Java. I am trying to implement if-modified-since request and got stuck with questions:
- Client sends a get request and the server responds with a resource and a
Last-Modifiedheader. From then on, client sends a request with theLast-Modifiedin theif-modified-sinceheader. Does this mean that, the first get request from client does not have aif-modified-sinceheader ? - Would the
Last-Modifiedreceived in the response stored in the browser for ever or should it be stored some where in the client side database to make further requests?
No, there won't be an if-modified-since if the client does not have a cached version of the resource.
This is up to the client. Browsers certainly don't cache everything indefinitely. But in theory an arbitrary client could store the last modified timestamp wherever it needs to.