On Wed, Jan 22, 2014 at 12:41:30PM +0100, Petr Bena wrote:
1) Retrieve the page - page must not be changed starts
NOW
2) Do something what requires user input, possibly may last few minutes
3) Save the page ONLY if it wasn't changed, if it was, go back to step 1
The way we should *cough* do this is If-Unmodified-Since.
http://restpatterns.org/HTTP_Headers/If-Unmodified-Since
It should be passed a value that matches a Last-Modified value that we
get from the previous "fetch page contents" API call.
But, I'm not convinced we could do this with our current API setup...
I think there are too many overlaps between things. Last-Modified may
apply, in this case, to the text of the page you're fetching, or, since
you can batch requests, it may apply to the image information you're
fetching, or the post count of the Flow board you're fetching, which
may cock up your estimate. And how the API is supposed to know what part
of the API call is constrained by the If-Unmodified header is beyond
me. Then again, you could apply it to all of them, and just pass the
date of your last request as the value.
I'd be interested to see this happen, but I suspect it would take a lot
of digging. :)
--
Mark Holmquist
Software Engineer, Multimedia
Wikimedia Foundation
mtraceur(a)member.fsf.org
https://wikimediafoundation.org/wiki/User:MHolmquist