First,
headers
and
expires
modules must be enabled on the server:
sudo a2enmod headers 
sudo a2enmod expires
After that the server must be restarted:
service apache2 restart
Then it will work if
.htaccess
contains the following:
# for enabling browser caching
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
by Valeri Tandilashvili
4 years ago
Linux
0
Pro tip: use ```triple backticks around text``` to write in code fences