Hacker News new | ask | show | jobs
by dougws 5056 days ago
Seems like it's likely to be very difficult for a browser to detect whether or not a given request is idempotent, no? You could use HTTP verbs (i.e. assume that GETs are and POSTs are not) but then you're trusting the server to use REST correctly.
2 comments

RFC 2616

> 9.1.2 Idempotent Methods

> The methods GET, HEAD,

> PUT and DELETE share this property. Also, the methods OPTIONS and

> TRACE SHOULD NOT have side effects, and so are inherently idempotent.

RFC 2119

> 4. SHOULD NOT

> This phrase, or the phrase "NOT RECOMMENDED" mean that

> there may exist valid reasons in particular circumstances when the

> particular behavior is acceptable or even useful, but the full

> implications should be understood and the case carefully weighed

> before implementing any behavior described with this label.

What could possibly go wrong?

Obviously we aren't going to be able to blindly enable this optimisation without making sure our apps meet the assumptions first.

I had the same sort of thought: it's really, really difficult for the bulk of programmers to create an idempotent operation. Therefore, through no fault of its own, TCP Fast Open would acquire a reputation for goofy behavior.