New answers tagged

0 votes

How do I prevent a form from being cached for anonymous users?

In order to prevent a form from caching at all, you can include the following #cache key in your form along with max-age & context attributes: $form['#cache'] = [ 'max-age' => 0, 'contexts' =...
mini's user avatar
  • 692

Top 50 recent answers are included