Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Youtube LiveChatMessages resource caching with ETag not work

$
0
0

My app every 5s requests live chat messages for YouTube live stream api and to prevent unnecessary data transfers I'm also utilizing ETags.

const auto listLiveMessagesRequest = yt::api::live::listLiveChatMessagesRequest(clientSecret).setParts({"snippet", "authorDetails"}).setFields("etag,items(id,etag,snippet(type,publishedAt,,displayMessage),authorDetails(channelId,displayName))").setLiveChatId(liveBroadcast->liveChatId).setMaxResults(200);mRefreshLiveChatFuture = std::async(yt::api::fetch, listLiveMessagesRequest.url, auth.accessToken, mLiveChatEtag);

https://developers.google.com/youtube/v3/live/docs/liveChatMessages/list

But I took note that my ETag caching has no effect on Live messages, since resource tag changes. As I suspect, its because that field constantly updated within resource:

pollingIntervalMillis

I compared two responses with different ETags and polling interval was the one changing.

Also, listing a live chat messages seems to have quite high quota cost of 5. Therefore eating 10k limit very easily!

Any other ways to enable resource caching? I notice of items[] that has their own ETags, but I wasn't able to figure out how request update only when items[] changed.

Resource caching with ETags to work as intended


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>