Is it safe to cache the static folder?

What would you recommend for the cache-control headers of the frontend? I’m hosting on a server with Caddy.

Do you think the following is ok:

  • Default - cache-control: public, max-age=0, must-revalidate
  • Everything in the /static folder - cache-control: public, max-age=31536000, immutable

I’m assuming the filenames added to the static folder via webpack are always unique so it’s safe to do this.

Here is what one of the Redwood docker nginx files does docker/nginx.conf at main · redwoodjs/docker · GitHub ? It’s looking at all the static types like js,css and fonts. Then caching them for specific times.