cosmicds / cds-api

API for accessing the CosmicDS database
GNU General Public License v3.0
0 stars 3 forks source link

Add `last_checked` parameter to stage 3 data route #68

Closed Carifio24 closed 1 year ago

Carifio24 commented 1 year ago

This PR adds support for a last_checked query parameter to the /stage-3-data endpoint (which is poorly named after the stage refactor, but not a problem for right now). This value of this parameter should be an integer that represents a Unix timestamp (in milliseconds). If none of the class data points have been changed since this timestamp, an empty array is returned to indicate that nothing has updated.

The idea behind this is to avoid sending the class data on every endpoint hit. While the data returned on any particular request shouldn't be large, this request gets fired a lot from the Hubble story. Hopefully returning an empty payload most of the time will yield a decent reduction in network traffic.