Hi,
I was just wondering what the recommended way of caching is. Is there only ETag? Should one use ETag for caching?
As far as I can tell If-Modified-Since is not supported. Is there any plans of making the HTTP response include the last-change date so I can send requests with If-Modified-Since header?
Cheers, Reinhard
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة rednoah
بتاريخ نوفمبر 19, 2013 في 2:11 صباحا
Actually ETag doesn't seem to work.
Request is setting If-None-Match correctly but server is responding with 200 OK + data instead of just rending back a 304 Not Modified: http://snag.gy/mIkt9.jpg
رد بواسطة Travis Bell
بتاريخ نوفمبر 19, 2013 في 10:12 صباحا
Have you taken a look at this thread: https://www.themoviedb.org/talk/5162e6e8760ee374b610b24e
رد بواسطة rednoah
بتاريخ نوفمبر 19, 2013 في 8:21 مساءا
(my bad, had If-Modified-Since set which apparently cancels out If-None-Match)
رد بواسطة rednoah
بتاريخ نوفمبر 19, 2013 في 9:16 مساءا
Got it working now. Just need to make sure If-Modified-Since is not set if If-None-Match is set. Though why the above curl call didn't work is beyond me...
رد بواسطة rednoah
بتاريخ نوفمبر 19, 2013 في 9:22 مساءا
If I get back "304 Not Modified" does the request count towards the rate limit?
رد بواسطة Travis Bell
بتاريخ نوفمبر 21, 2013 في 10:42 مساءا
Hi rednoah,
It will count towards the rate limit. The benefit is the saved transfer on both our end and your client(s). This results in less resources being used all round and just being a better API consumer.
رد بواسطة caprica6
بتاريخ يناير 21, 2014 في 9:50 صباحا
I am trying to use etags but it does not seem to work for me.
Can anyone see what I am doing wrong?
So here we can see the etag is:
Now I pass that same etag in the If-None-Match header...
I still get a 200 response and the entity.
What have I missed?
رد بواسطة Travis Bell
بتاريخ يناير 21, 2014 في 7:09 مساءا
I can replicate this, I suspect the change was caused when we removed Varnish from our stack. I'll have to spend some time digging into this and seeing if we can take care of this properly at the app level.
Here's the relevant ticket.
Cheers.
رد بواسطة rofrantz
بتاريخ مارس 27, 2014 في 11:15 صباحا
Is this problem solved because I that same issue too.. Even if I send the If-None-Match I still get 200
رد بواسطة Travis Bell
بتاريخ مارس 27, 2014 في 11:33 صباحا
No, the problem is not fixed yet. The ticket is still open.
رد بواسطة mchiasson
بتاريخ نوفمبر 20, 2017 في 12:17 مساءا
3.5 years later, still looks like etag isn't working:
curl -i -H Accept:application/json -H If-None-Match:df2617d2ab5d0c85ceff5098b8ab70c4 -X GET 'https://api.themoviedb.org/3/genre/movie/list?language=en-US&api_key=API_KEY'
I still get 200
رد بواسطة Travis Bell
بتاريخ نوفمبر 20, 2017 في 2:43 مساءا
That is correct, it hasn't been fixed yet. I do not have an ETA for this issue at this time.
رد بواسطة rlaphoenix
بتاريخ فبراير 21, 2018 في 11:33 مساءا
Still not fixed? :/ I really need this.
رد بواسطة Travis Bell
بتاريخ فبراير 25, 2018 في 12:07 مساءا
By the way,
If-None-Match
works on most API calls now (the ones that return anETag
). I'll try to find some time to get the remaining methods that aren't returning anETag
completed soon.Responds with a regular
200
response, and if we make a call withIf-None-Match
...We're properly returning a
304
.Cheers.