Benjamin-Loison / YouTube-operational-API

YouTube operational API works when YouTube Data API v3 fails.
396 stars 49 forks source link

A policy about `etag`s should be defined #35

Open Benjamin-Loison opened 2 years ago

Benjamin-Loison commented 2 years ago

Official documentation: https://developers.google.com/youtube/v3/getting-started#etags

As currently showing 'etag' => 'NotImplemented', in item to look compatible with YouTube Data API v3 JSON parser but with such a constant value it isn't as far as I remember, so we should remove it until it is implemented.

Does the YouTube UI support ETags? I would say no with all tracker parameters, however using a well-designed filter function for each endpoint we can focus on changes of the actual data. It seems that the YouTube operational API instance can't use ETags or similar mechanism of the YouTube UI endpoints don't too, but the instance can propose such a mechanism with the end users.

A remaining question is does in theory we have:

  1. Data0 ETag0
  2. Data1 ETag1
  3. Data0 ETag2

Or

  1. Data0 ETag3

As in the second case, the instance can't distinguish both cases. It seems that we can avoid caching in the first case, by just using a hash function for instance.

+3

Benjamin-Loison commented 1 year ago

Will have to change most of my Stack Overflow answers once this issue will be closed.

Benjamin-Loison commented 1 year ago

Note that we might want the instance to be memory free, especially that the official one is used by many different persons that we can possibly assume not to useless repetitive request (looking for data change where they can't be any), so possibly assuming they have a local cache in some way.

Benjamin-Loison commented 1 year ago

https://stackoverflow.com/q/36490875 only seems to treat static files.