In general, the essence of the problem is that on the page there are 3 forms for updating data, one for the user profile, echoing the reset password 3rd for changing the email. I made the submission of forms to the controller and accordingly redirect to the same page. The project manager said that redirects need to be removed, they say people do not press F5, and repeated redirects will load the server. Maybe I don’t understand something, but I used to always redirect after sending a POST request. The proposal to make all forms through ajax rejected. In general, how can you justify correctly that a redirect is needed or am I mistaken?

In general, I asked a similar question in English on stackoverflow there they gave an interesting reference, I attach http://www.theserverside.com/news/1365146/Redirect-After-Post

  • 6
    This is how to disprove: 1) People are pressing reload 2) They are also pressing the "back" button 3) Loading the server with the redirect? Change the head. - PinkTux
  • @PinkTux he is our senior and in fact the employer, they will rather fire me =) - Serge Esmanovich
  • You can send data to the same controller (which renders the page with the forms). You took the data and immediately drew the "final, desired" page. Redirect is not needed, Ajax is not used. conditions are met? - noadev
  • Do you use symfony forms or not? - AmsTaFFix pm
  • one
    The commander said the chipmunk bird - it will fly. Said not tight - it means not tight. Do as the speaker says - Sergey

1 answer 1

The redirect does not load the server, in fact it turns out such a scheme:

1) POST processing

2) REDIRECT

3) Reply to customer

Your team leader offers 1-3 what it will save? if you have a project that every time a client addresses there is a tin that happens, then you need to look at the project so that this does not happen ...

PS And in fact, if +1 access to the server is so critical, then this is garbage and not the server)))

  • one
    @AmsTaFFix if the framework is so heavy that even initialization requires a noticeable amount of resources, then you should think about changing the framework - Ipatyev
  • about the question - I misunderstood it and in this particular case it’s worth making a redirect, regardless of the server load. Framework talk is holivar, in which I don’t want to participate :) - AmsTaFFix