ga4gh-discovery / data-connect

Standard for describing and searching biomedical data developed by the Global Alliance for Genomics & Health.
Apache License 2.0
24 stars 14 forks source link

Set out rules for cache-friendly conditional requests #107

Open jfuerth opened 3 years ago

jfuerth commented 3 years ago

This issue arose out of the discussion in #98.

The Search spec should reference the HTTP specification to say that servers MAY implement conditional HTTP requests using the standard (eTag/If-Match and Date/If-Modified-Since) headers to help clients take advantage of the built-in caching behaviour of HTTP.

ifokkema commented 3 years ago

I think this is a great suggestion. I suppose the idea is that we can hack ETags here and say, e.g.:

Request:

GET /tables/variants.hg19/data
If-Match: "data_license=cc_by_4.0"
...

Reply:

HTTP 200 OK
ETag: "data_license=cc_by_4.0"
...
<data>
ifokkema commented 3 years ago

While implementing this in LOVD3 (https://github.com/LOVDnl/LOVD3/issues/518), I realized:

(...) and Date/If-Modified-Since) headers (...)

This should be Last-Modified / If-Modified-Since.