Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
457 views
in Technique[技术] by (71.8m points)

YouTube v3 API Search etag is inconsistent

When using the search endpoint, I am getting one of a set of ETags for the same request, even if the content has not changed. This behaviour happens consistently and prevents me from caching the response as I do not always receive a 304 status.

Example: https://developers.google.com/youtube/v3/docs/search/list?apix=true&apix_params=%7B%22part%22%3A%5B%22snippet%22%5D%2C%22maxResults%22%3A1%2C%22order%22%3A%22viewCount%22%2C%22q%22%3A%22skateboarding%20dog%22%2C%22type%22%3A%5B%22video%22%5D%2C%22videoDefinition%22%3A%22high%22%7D

This is taken from YouTube's own documentation but limited to one search result.

The response includes a random one of two ETags, these being:

"etag": "-729CMjUYIG2kMmgCBFB77g7ibc"

or

"etag": "P9FEgO5WTt8njOwQgoPMkE8hZdI",

The rest of the data, including the etag of the item in the items array is unchanged.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...