For twig

base.html.twig :

<p{{ 'message'|trans }}</p>

Create or update your files translation :

# tempate from app/Resources
php bin/console translation:update --dump-messages --force fr
php bin/console translation:update --dump-messages --force en

# template from AppBundle/Resources
php bin/console translation:update --dump-messages --force fr AppBundle
php bin/console translation:update --dump-messages --force en AppBundle

 

How to add expire header on Ubuntu with Apache2 :

Edit your httpd.conf

  1. The module ‘mod_expires’ must be activated
  2. Add the new configuration

1) Activate mod_expires

sudo a2enmod expires
sudo /etc/init.d/apache2 restart

2) Add new lines on your httpd.conf

nano /etc/apache2/apache2.conf

Then add these lines at the end

ExpiresActive On
ExpiresByType image/gif “access 1 month”
ExpiresByType image/jpg “access 1 month”
ExpiresByType image/jpeg “access 1 month”
ExpiresByType image/png “access 1 month”
ExpiresByType text/css “access 1 month”
ExpiresByType text/js “access 1 week”
ExpiresByType application/javascript “access 1 week”

the restart

sudo /etc/init.d/apache2 restart

Example :