Last-Modified

18 views
Skip to first unread message

Derek Haidle

unread,
Jul 1, 2016, 3:33:43 PM7/1/16
to thebluealliance-developers
All,

First time posting, so a quick introduction.  I am a mentor on team 2526.  My son and I really enjoy robotics and are playing around with learning Swift for iOS over the summer.  We thought it would be a fun project to pull in some data from your site and play around with it.  By the way, a huge "thank you" to the team for all of the wonderful work you do to make the data clean and accessible.

My question is around the use of the Last-Modified field in the header.  From my understanding, when doing subsequent requests, we should include the last Last-Modified date to have the system determine if there is a change.  We are specifically grabbing team media.  The payload of the request seems pretty small - a few media elements come back for each team.  Is there much of a gain at all in providing the Last-Modified date with a rather small/simple request?

Also, do you have stats on how frequently the Last-Modified date is used?  I would just be curious to see if it is widely implemented.

Again - much respect for all of the work you've accomplished here.  By the way, I searched for any discussion around this, but didn't find anything.  If I missed something, please just point me in the right direction.

Thanks!
Derek

Phil Lopreiato

unread,
Jul 1, 2016, 4:12:53 PM7/1/16
to theblueallian...@googlegroups.com
The idea behind implementing Last-Modified is to save the backend from making expensive queries to serve API requests. When clients poll the API for changes, they're requesting the same data at a high frequency, resulting in lots of wasted work. Additionally, using this header is an easy to to determine "Has the endpoint changed since time X" (if the response code is 304, then you know it hasn't changed). Of course, this also helps save bandwidth, if you're not returning large responses all the time.

For your specific use case, it probably doesn't matter much, since the requests will be served by cache anyway and they're pretty small to begin with. I don't think it matters much, except as an educational exercise.

As far as existing use cases go, the TBA Android app (>75% of API requests, IIRC) makes use of it. We try to optimize that use case for cache performance (both locally on the device and Cloudflare's), so it makes sense in that application.

Hope this helps,
Phil

--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.
To post to this group, send email to theblueallian...@googlegroups.com.
Visit this group at https://groups.google.com/group/thebluealliance-developers.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages