Meta API Cache

51 views
Skip to first unread message

deft...@gmail.com

unread,
Oct 29, 2020, 4:12:18 PM10/29/20
to VersionOne-dev
Hello guys,

I'm working on a tool that uses the VersionOne Meta API. I need to get details about defect attributes in the JSON format so I send the following request (I'm using the API Examples VersionOne instance just for demonstrating purposes):

curl -H 'Authorization: Bearer 1.aBg7sVXSZeEsf3cwvQFEdkkt384=' -H 'Accept: application/json' https://www16.v1host.com/api-examples/meta.v1/Defect

It worked fine. But in one day I noticed it gets the response in the XML format. I've started to dig and found the response is cached for one hour (Cache-Control: public, max-age=3600) and the Vary header includes only the Accept-Encoding header and doesn't include the Content-Type header. So if the cache is stale and someone sends a request for getting metadata in the XML format, that response will be cached for 1 hour and sent to everyone disregarding the Accept header value specified in the request. I've tried to add -H 'Cache-Control: no-store' to the request but it doesn't help.

The issue can be reproduced by following these steps:
  1. curl -H 'Authorization: Bearer 1.aBg7sVXSZeEsf3cwvQFEdkkt384=' -H 'Accept: application/json' -H 'Cache-Control: no-store' https://www16.v1host.com/api-examples/meta.v1/Defect
  2. curl -H 'Authorization: Bearer 1.aBg7sVXSZeEsf3cwvQFEdkkt384=' -H 'Accept: text/xml' -H 'Cache-Control: no-store' https://www16.v1host.com/api-examples/meta.v1/Defect
Can anybody from the VersionOne team handle that issue, please?

pavel

unread,
Nov 10, 2020, 12:24:07 PM11/10/20
to VersionOne-dev
We have a defect in our backlog about meta.v1 handler erroneously responding with same ETag for different response content types (XML vs JSON), which then leads to our CDN provider returning improperly-cached response and omitting "Vary: Accept" response header.

As a workaround, you could pass desired content type via "accept" query string parameter instead of "Accept" header, ie https://www16.v1host.com/api-examples/meta.v1/Defect?accept=application/json

deft...@gmail.com

unread,
Nov 11, 2020, 8:55:43 AM11/11/20
to VersionOne-dev
Thank you so much, Pavel!

вторник, 10 ноября 2020 г. в 19:24:07 UTC+2, pavel:

deep thoughtm

unread,
Nov 11, 2020, 8:55:43 AM11/11/20
to version...@googlegroups.com
Try support at digital.ai or stack overflow.  You probably won’t get a response here from V1 team since they stopped supporting the versionOne-dev group about 5 years or so ago.

--
You received this message because you are subscribed to the Google Groups "VersionOne-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to versionone-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/versionone-dev/04799faa-8ffb-446c-bdb7-c28baf924fa4n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages