RobbinBaauw / CSHub

CSHub
https://cshub.nl
MIT License
29 stars 7 forks source link

[Backend Rewrite] Posts #214

Open RobbinBaauw opened 4 years ago

RobbinBaauw commented 4 years ago
RobbinBaauw commented 4 years ago

It would also be nice to have an endpoint where the client just gets the bare minimum paginated information.

Right now, a request is first sent to get all the posts, and then everything about that post is retrieved (except for the content). This can be replaced by a single endpoint which provides the title and some date information of the currently visible posts.

Upon clicking on a post it will send a request to the server to either retrieve the content etc (if not cached), or it will just check if there are any updates. The service worker on the client should be extended to cache everything, so we basically never have to wait and everything will be much snappier.

For this issue this concretely means that the endpoint for retrieving "postHashes" of a topic will be replaced by an endpoint which gets both these "postHashes" and the title and date information. The service worker stuff can be done with the current endpoints and only requires changes on the client.

NULLx76 commented 4 years ago

It would be a substantially bigger change but we could also add a GraphQL(-like) API, so that the client can specify exactly what it wants.