You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interested on this too.
Not sure if the reproduction helps. It's always giving me a max-age of "31536000", no matter the maxAge value passed in config.
By default, maxAge is ignored — it takes the value from the external domain, as you can see in this MR.
Luckily, this follow-up MR gives us a way to control that behaviour.
To make your custom maxAge actually work, you’ll need to set ignoreCacheControl: false:
image: {ipx: {http: {maxAge: 60*60*24*365,ignoreCacheControl: false// <--- this one matters!}}}
Unfortunately, @nuxt/image still overrides runtimeConfig, so you can’t set these values via env vars 😅
But static config in nuxt.config.ts works just fine.
This behaviour is still under-documented, and it would be great to have it clarified in the official documentation.
// nuxt.config.tsexportdefaultdefineNuxtConfig({modules: ['@nuxt/image',],image: {ipx: {maxAge: 31_536_000,// one yearfs: {maxAge: 31_536_000,// one year},http: {maxAge: 31_536_000,// one year},},},routeRules: {'/': {prerender: true,// prerender home page in build time},},})
then keep in mind that IPX images are generated at build time and placed into .output/public/_ipx directory.
In production, these files may be served as static assets instead of going through the IPX server, so the IPX response headers will not be applied. In that case, you need to handle cache headers yourself.
In my case, I use nginx as a reverse proxy. A simplified config could look like this:
server{server_name lukas-pierce.com;location / {include snippets/nuxt-proxy.conf;}location~* ^/_ipx/.*\.(avif|webp|png|jpe?g|svg|gif)$ {add_header Cache-Control "max-age=31536000, public, s-maxage=31536000"; # Same as IPX
include snippets/nuxt-proxy.conf;}
... # other nginx settings
}
Activity
urbgimtam commentedon Sep 19, 2023
Interested on this too.
Not sure if the reproduction helps. It's always giving me a max-age of "31536000", no matter the maxAge value passed in config.
https://stackblitz.com/edit/github-ac11u5?file=app.vue
Pierre-Saigot commentedon Sep 22, 2023
Same..
krthr commentedon Sep 25, 2023
Same
yuzu-qroulland commentedon Sep 29, 2023
Hi everyone,
I'm coming back to you because I've found a solution in the meantime. 🥳
With the following statement the maxAge is well taken into account:
Just need to set the maxAge into an options object. 🧐
However, I don't know whether this is the expected behavior and therefore the documentation is out of date, or whether it's a design error. 👀
manchenkoff commentedon Oct 1, 2023
@yuzu-qroulland yep, that works! thanks 👍
rahulkumarsingh73690 commentedon Nov 16, 2023
Any update? @yuzu-qroulland
Nothing worked for me
manchenkoff commentedon Nov 16, 2023
just fyi, since I upgraded to Nuxt 3.8 it works even with default config like
rahulkumarsingh73690 commentedon Nov 16, 2023
Thanks @manchenkoff for sharing.
My app is hosted in Digitalocean app platform and this is not working for me
Nuxt - 3.8
Nuxt/image - 1.0.0
cernymatej commentedon Nov 25, 2023
Now the
optionskey seems to have been removed fromIPXRuntimeConfigand it doesn't work at all for me 😕Nuxt - 3.8.2
Nuxt/Image - 1.0.0
raphaelbernhart commentedon Jan 2, 2024
For me it is working with the following config:
damvik commentedon Jan 24, 2024
I am currently facing a similar issue, but it seems to be limited to external domains.
Image from external domain

Images from public dir


dependecies
{ "devDependencies": { "@nuxt/devtools": "latest", "@nuxt/image": "^1.3.0", "@nuxtjs/fontaine": "^0.4.1", "@nuxtjs/google-fonts": "^3.0.2", "@nuxtjs/i18n": "^8.0.0", "@nuxtjs/tailwindcss": "^6.10.0", "@tailwindcss/forms": "^0.5.7", "@vueuse/core": "^10.7.0", "@vueuse/nuxt": "^10.7.0", "nuxt": "^3.9.3", "nuxt-icon": "^0.6.8", "nuxt-svgo": "^4.0.0", "vue": "^3.4.15", "vue-router": "^4.2.5" }, "dependencies": { "@pinia/nuxt": "^0.5.1", "@splidejs/vue-splide": "^0.6.12", "photoswipe": "^5.4.3", "pinia": "^2.1.7", "qs": "^6.11.2", "vue-multiselect": "^3.0.0-beta.3" } }nuxt.config.ts
I am aware that this functionality was functional in the past. An illustrative example can be found at the following link: https://stackblitz.com/edit/github-ac11u5?file=app.vue.

@pi0 Could you help me solve the problem?
kytosai commentedon May 25, 2024
I have same problem, setting max age for ipx dont work with external domain. Only work with public folder path
Setting in nuxt config
External domain:
Public folder path
aetievant commentedon Aug 13, 2024
Hello,
I'm facing the exact same issue than @gnidustotalus and @kytosai here, not able to set
Cache-Controlheader for external domains.Is there any news on a fix or at least a workaround? It's quite annoying to not be able to proxy cache images generated by IPX...
Thanks!
aetievant commentedon Aug 13, 2024
I actually found a workaround which consist to deal with
nuxt.config.jsconfiguration and nitro route rules:Not optimal but currently I will live with this, until there is a real fix to solve that issue.
Hope it helps!
jlemonz commentedon Mar 4, 2025
Hi. How can i increase cache time when using vercel? Does this also work? RIght now its 3600s
VasiliyRusin commentedon Oct 16, 2025
@aetievant
@kytosai
@gnidustotalus
Hey folks 👋
By default, maxAge is ignored — it takes the value from the external domain, as you can see in this MR.
Luckily, this follow-up MR gives us a way to control that behaviour.
To make your custom maxAge actually work, you’ll need to set
ignoreCacheControl: false:Unfortunately, @nuxt/image still overrides
runtimeConfig, so you can’t set these values via env vars 😅But static config in nuxt.config.ts works just fine.
This behaviour is still under-documented, and it would be great to have it clarified in the official documentation.
lukas-pierce commentedon Jul 7, 2026
I just accidentally discovered that in
nuxt.config.ts,maxAgefor local images needs to be specified inside thefsobject:@danielroe I think this should also be mentioned on the documentation page: https://image.nuxt.com/providers/ipx
Also, if you use prerendering, for example:
then keep in mind that IPX images are generated at build time and placed into
.output/public/_ipxdirectory.In production, these files may be served as static assets instead of going through the IPX server, so the IPX response headers will not be applied. In that case, you need to handle cache headers yourself.
In my case, I use nginx as a reverse proxy. A simplified config could look like this: