2 ms·
> And it's not always safe to retry POSTs. If POST is an insert, for example, retrying it would produce two inserts. [...] Suppose that you have sent a POST req
by naasking 10y ago
> And it's not always safe to retry POSTs. If POST is an insert, for example, retrying it would produce two inserts. [...] Suppose that you have sent a POST request, but before you could read the response, connection dropped.
My previous post already covered idempotent POSTs via futures. The fact is, only the application can decide whether a POST is safe to retry arbitrarily or must be made safe by binding to a future. The PUT is merely a small optimization that is now obviated by the spread of HTTPS.
- int_19h 10y agoYou assume the entire stack is HTTP end-to-end, which is not always the case.
- naasking 10y agoHow am I assuming that exactly?
- int_19h 10y ago"The PUT is merely a small optimization that is now obviated by the spread of HTTPS."
- naasking 10y agoStill not seeing how that line means I'm assuming HTTP end to end.
- int_19h 10y agoIf I understand your point correctly, you're saying that when something is talking over HTTPS, the middleware doesn't get to see the verbs, and so it can't optimize for them anyway. But if part of your connection is using different transports, then middleware in those segments can observe the verbs and react accordingly (including e.g. local retries in face of adverse network conditions, to avoid expensive end-to-end roundtrips).
- naasking 10y agoWhile technically correct, I'm not sure how this is useful. You use HTTPS to communicate with an endpoint you trust, and anything beyond that is internal network infrastructure which is much more reliable than the HTTPS hops. The utility of local retries on this last hop don't seem compelling.
- dragonwriter 10y ago> The PUT is merely a small optimization that is now obviated by the spread of HTTPS. Idempotence can be useful knowledge for client-side caches, so HTTPS doesn't obviate the value of the PUT (or, for the same reason, DELETE) vs. POST distinction.