If you are seeing the “Serve static assets with an efficient cache policy” notice in PageSpeed, you need to add the
Cache-Control header to your website.
Here is how to do it if you are using Caddy.
To set a
Cache-Control header only for your static files like, .js, .jpg, and others, just add this to the relevant part of your Caddyfile(under the site block if the Caddyfile includes multiple websites)
The files are going to be cached for
5184000 seconds, so 60 days, you can change it if you want.