Compiled templates, container caches and route caches are regenerated on demand and written thousands of times, and every one of those writes goes to disk for no reason.
# /etc/fstab
tmpfs /var/www/app/var/cache tmpfs defaults,size=256M,mode=0755,uid=33,gid=33 0 0
# or in compose
# tmpfs:
# - /app/storage/framework/views:size=64m
The measurable gain is modest on an SSD and considerable on network storage, which is where this actually matters — a container platform with a slow overlay filesystem makes template compilation a visible cost. The thing to check is that the directory is genuinely disposable: anything in it that is generated at deploy rather than on demand disappears on reboot and has to be regenerated by the boot sequence. Getting that wrong produces a machine that works until it restarts.