diff --git a/nuxt-frontend/nuxt.config.js b/nuxt-frontend/nuxt.config.js index 75d8f4d58..42f286668 100644 --- a/nuxt-frontend/nuxt.config.js +++ b/nuxt-frontend/nuxt.config.js @@ -1,5 +1,7 @@ // https://nuxt.com/docs/api/configuration/nuxt-config import { defineNuxtConfig } from "nuxt/config"; +const yearInSeconds = 365 * 24 * 60 * 60; // 365 days * 24 hours * 60 minutes * 60 seconds + export default defineNuxtConfig({ app: { head: { @@ -34,5 +36,17 @@ export default defineNuxtConfig({ prerender: { failOnError: false, }, + routeRules: { + "/img/**": { + headers: { + "cache-control": `public,max-age=${yearInSeconds},s-maxage=${yearInSeconds}`, + }, + }, + "/_nuxt/**": { + headers: { + "cache-control": `public,max-age=${yearInSeconds},s-maxage=${yearInSeconds}`, + }, + }, + }, }, });