You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, inso_gist.h is totally synchronous — when modules using it like mod_quotes do an upload, their response can feel laggy since they do the upload immediately before responding.
It is actually a bit worse than that, since they will first do a GET with If-Modified-Since to get any changes to the gist that may have occurred since the last check. This stops any manual gist changes from being overwritten, but again adds some lag.
If GitHub correctly supported the If-Match header on their gist patch API, the GET request would be unnecessary most of the time, but unfortunately their API is broken and responds with a 412 but still modifies the contents in the presence of a non-matching If-Match. It also seems to ignore If-Unmodified-Since.
A decent way to improve the responsiveness would be to assume the gist hasn't changed, update based on our local data, start the GET + upload in a background thread (or via curl's async multi interface), then we can respond immediately.
The problem is we would need to have a way of handling merges if the async GET got an updated gist, and potentially correct our response if it included wrong info (like a stale quote ID). Having multiple async uploads in flight could also be problematic, especially if an early one needs merging... needs some further thought.
The text was updated successfully, but these errors were encountered:
Currently, inso_gist.h is totally synchronous — when modules using it like mod_quotes do an upload, their response can feel laggy since they do the upload immediately before responding.
It is actually a bit worse than that, since they will first do a GET with If-Modified-Since to get any changes to the gist that may have occurred since the last check. This stops any manual gist changes from being overwritten, but again adds some lag.
If GitHub correctly supported the If-Match header on their gist patch API, the GET request would be unnecessary most of the time, but unfortunately their API is broken and responds with a 412 but still modifies the contents in the presence of a non-matching If-Match. It also seems to ignore If-Unmodified-Since.
A decent way to improve the responsiveness would be to assume the gist hasn't changed, update based on our local data, start the GET + upload in a background thread (or via curl's async multi interface), then we can respond immediately.
The problem is we would need to have a way of handling merges if the async GET got an updated gist, and potentially correct our response if it included wrong info (like a stale quote ID). Having multiple async uploads in flight could also be problematic, especially if an early one needs merging... needs some further thought.
The text was updated successfully, but these errors were encountered: