Add last-modified header to API results that return a collection
kjolley opened this issue · comments
We can use max(datestamp) for isolates, alleles, and profiles.
Note that we can already detect which loci have had new or modified alleles since a specified date or a relative date (https://bigsdb.readthedocs.io/en/latest/rest.html#db-loci and https://bigsdb.readthedocs.io/en/latest/rest.html#db-schemes-scheme-id-loci).
Taking a look at this more closely, I can see that the information is already available for alleles, schemes, and isolates from the locus, scheme, and isolates top-level routes as the last_updated or last_added attribute, e.g. http://rest.pubmlst.org/db/pubmlst_neisseria_seqdef/loci/PorA_VR1/alleles, http://rest.pubmlst.org/db/pubmlst_neisseria_seqdef/schemes/1, and http://rest.pubmlst.org/db/pubmlst_neisseria_isolates/isolates.
For this reason, I think it is better not to implement this since it will result in a small performance penalty caused by an additional database query for each call.