The Post-Redirect-Get is a popular pattern in websites seeking to prevent users from reposting data by accident (e.g. refreshing the checkout page and then being charged again.)
Just to refresh, the process is as follows:
- User submits data which is POSTed to the server
- Server processes form data, and issues a REDIRECT
- Browser receives the REDIRECT and the GETs the new page
Because the final step is a GET (and not a POST), refreshing the page has no effect (assuming you’re not posting data via a get, in which case you should have your internet connection revoked).
What you may not know is the there is a standard HTTP response code for this operation – and it’s not 302, it’s 303. It’s a tiny detail, but an important one. If you’re using PRG as a pattern, make sure that whatever server tech you’re using issues the correct status code – it’s the little things that make all the difference. Just ask Apple.
(The ASP.NET MVC Controller.Redirect method uses 302, natch.)