Open harunurhan opened 5 years ago
https://github.com/inveniosoftware/invenio-records-rest/pull/273
We cannot use an ETag
which uses both the revision id and content-type with the current implementation since ETag
are used both as a caching mechanism and for concurrency control. For caching it works:
will get you the right content and caching works.
However, if you do:
This probably will fail (please verify) and we need to find a solution that separates these concerns.
check_etag
works correctly with weak and strong ETags
When you rely on
Content-Type
and different serializers of same record to serve different formats under same url, you might have caching issues on most of the browsers. Because invenio setsLast-Modified
andEtag
based on only record's version.So it's likely that browser will reply with a different format to requests that has the same url. For example
application/json
instead ofapplication/x-bibtex
, because of sameEtag
andLast-Modified
Quick workaround would be remove
Last-Modified
and putEtag
that includes bothversion
andContent-Type
.