New answers tagged caching
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' =...
Top 50 recent answers are included
Related Tags
caching × 14228 × 386
7 × 338
views × 120
theming × 111
blocks × 107
performance × 90
6 × 80
proxies × 65
database × 56
nodes × 44
entities × 40
users × 35
forms × 33
9 × 32
cron × 31
javascript × 28
routes × 28
hooks × 27
drush × 26
media × 24
ajax × 21
commerce × 17
navigation × 17
configuration × 14