Pregunta

The Post/Redirect/Get idiom is used when generating a REST page from a POST query. The POST puts data into the database, and the GET retrieves it and generates the page.

How can such an implementation avoid the round trip to the database? In terms of performance, it's better to reduce the number of queries. Some NoSQL systems don't make submissions immediately visible in query results, but prefer a few seconds for data to percolate in the database before retrieving it.

The underlying problem is that Post/Redirect/Get requires two queries from the client, which could be distributed to different servers. The idiom introduces genuine physical issue.

It seems very improper to require a database modification just to avoid the "would you like to resubmit the form" message. What can I do?

¿Fue útil?

Solución

Well, now that I've earned my first tumbleweed badge… I plan to solve this problem using AJAX to dynamically change the database-related content with no reload. That way I can POST to the server to my heart's content without the user ever getting a warning.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top