An efficient way to avoid multiple unnecessary requests followed is to use a captcha service, so the request is only made once and once the user has sent the captcha, this prevents multiple requests and also the problem of possible spam. / p>
But captcha ends up sending the form slower for the user (which is disgusting), so one solution that comes to mind is:
You can store in a session the exact time the last request was made, and set a minimum time limit for a new action.
You can also disable the submit button with the disabled
attribute using javascript, this will cause a more pleasant effect although the user may have javascript disabled.
The script below can help:
$('form').on('submit', function() {
$(this).find('[type="submit"]').attr('disabled', 'disabled');
});