I’m not sure if the PRG pattern is the right choice in my case. Before I introduce my case, PRG stands for Post/Redirect/Get and you can read up on it here: Wiki-article
I’ve got a search page, the search is done with a POST request (and there’s a lot of parameters). You typically search for orders, and you can search on address, dates, persons and so on. Lets say you do a search and then open an order. Now, if you go back, your client asks you with an annoying pop-up: “Do you want to resend the post request with its parameters?” (or something like that).
That pop-up is annoying, and I dont think my customer would like to have it 🙂
I was thinking, maybe it would be good to store the post parameters in the session, provide a link (so you have to use that link, and cannot click “back” in your client) which makes a new post request with those parameters stored in the session, and there will be no annoying pop-up…
Then I googled around and found the PRG pattern, which seems complicated and requires some extra coding. My concern to the whole idea, why not just make the whole search use GET instead of POST.
So this issue/question of mine is asking:
- Should I use POST or GET for my search
- If I use POST, is my idea or the PRG pattern better?
Thanks!
GET, definitely.
PRG pattern is just inapplicable here.