V
V
Vladimir Kuts2021-04-16 09:23:08
RESTful API
Vladimir Kuts, 2021-04-16 09:23:08

Request for a new piece of data?

The situation is this.
Let's say my front has loaded a certain amount of data via GET from the server. Saved for myself.
GET /api/v1/somedata/
Now, in order not to jerk the server once again when redrawing the screen, the front uses the saved data.
But now, before redrawing the screen, I need to make a request to the server - whether new data has appeared, or whether the old ones have changed ...
On the server, after updating the data, a certain label will change, with which the front will compare the label of its data.
So - how is it semantically correct to do this?
Making a separate GET request for this - looks like a bit of a crutch in my opinion.
GET /api/v1/somedata/timestamp/
Is it possible to use, say - somehow the HEAD method to do this?
HEAD /api/v1/somedata/
Or am I missing something obvious? )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2021-04-16
@sidni

Maybe you need Pagination by cursor.
https://itnan.ru/post.php?c=1&p=419083
You can use the creation date instead of the cursor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question