How are we meant to cache the request? Theres no ETag or anything. As in, how are we meant to check if for example: api/3/{movie/tv}/{tmdbid} is updated? I can cache using localStorage, but how am I meant to know if I should use the cached version, or re-grab. Is there any /sync/last_activities like Trakt?
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة jamesb16
بتاريخ فبراير 22, 2018 في 6:46 مساءا
pragma account cracker, movie watcher :))
رد بواسطة Travis Bell
بتاريخ فبراير 23, 2018 في 1:55 مساءا
Hey @PRAGMA,
Etags have been restored. I thought it was odd to hear it wasn't present as I know I looked into this years ago and indeed, it was a bug introduced a few months ago.
رد بواسطة rlaphoenix
بتاريخ فبراير 23, 2018 في 5:46 مساءا
ETag isnt on /discover is this expected?
رد بواسطة Travis Bell
بتاريخ فبراير 23, 2018 في 5:53 مساءا
Yes, for now. Etags were easy to restore on our Ruby stack. People, discover, search, lists and v4, are all on our Lua stack. That's an entirely different thing.
رد بواسطة rlaphoenix
بتاريخ فبراير 23, 2018 في 5:55 مساءا
Alright, and just to confirm, I should store the Etag on first request, and then when re-doing the request, do If-None-Match: and that will send the request but wont count towards rate-limit right?
رد بواسطة Travis Bell
بتاريخ فبراير 23, 2018 في 5:57 مساءا
That's the correct strategy yes, but I don't believe our rate limiting is sophisticated enough to not make that request count. I believe it still counts.
رد بواسطة rlaphoenix
بتاريخ فبراير 23, 2018 في 6:48 مساءا
Then wouldnt using Etag on /movie/{id}/ essentially useless?
رد بواسطة Travis Bell
بتاريخ فبراير 23, 2018 في 6:55 مساءا
Not really, it saves you from downloading the response. In any case, none of this has really ever been supported (etags didn't even work for ~3 months)
One day perhaps things will get an update to be smarter about this, but in order to make the rate limiting aware of
If-None-Match
is actually a huge re-factor of the way our infrastructure works today. Rate limiting stands in front of our app infrastructure as a standalone service so it has no idea what happens once you've been allowed through. A 200, 404 or HEAD, are all the same to it.رد بواسطة rlaphoenix
بتاريخ فبراير 23, 2018 في 7:19 مساءا
But doing an Etag still responds a JSON result though?
رد بواسطة Travis Bell
بتاريخ فبراير 25, 2018 في 11:45 صباحا
Yes, if the response has changed. It's a conditional call, look at the following as examples:
Repsonds with the body as a regular
200
response. Now if we make another request with theETag
we got back in the first request, you'll see it responds with no body, as a304
response.Now, let's say the
ETag
changes (I'll fake this by changing the ETag I query):You get another
200
response with the body and a newETag
.