Yes, you need to set Cache-Control and Expires in the HTTP header for static resources so that this Google PageSpeed โโmessage does not display.
Since you are already using the Elixir version control tool, you can safely install Expires from JS / CSS files for 1 week.
The way to do this depends on which web server you are using.
If you are using Apache , you can put the following code in .htaccess or the configuration file of your virtual website.
<FilesMatch "\.(js|css)$"> ExpiresActive On ExpiresDefault "access plus 1 weeks" </FilesMatch>
Be sure to enable the mod_expires Apache module!
With the same syntax, you can configure caching rules for .html, .jpg, .png, etc. files to speed up page loading.
If you are using nginx, there are similar ways to solve this problem, you can follow this tutorial
source share