Replace "ajax" enpoints with a proper REST API
Currently all asynchronous requests are directed to URLS like https://lhcb-nightlies.web.cern.ch/ajax/nightly/doc/lhcb-master-mr/497/ using POST method.
Apart from the fact that ajax is not correct, because we do not get XML out of it, the use of POST prevent caching at the browser level. A better approach would be to use GET and properly handle ETag
and If-None-Match
headers (see,for example, !13 (diffs)).
It's also very appropriate to create endpoints like /api/v1/some_action
and properly document them. Still to decide which arguments to embed in the URL and which in GET arguments.
For example, we can get the list of latest slots builds with /api/v1/latest-builds
, then, to only get the list of builds newer than a given time, we could use something like /api/v1/latest-builds?since=2020-02-01
.