image
image copied to clipboard
hash filenames with ipx
Hello,
IPX is generating paths like: /_ipx/images/homepage/top-slider/logo-colipays-bordeaux-gris.png?fit=fill&s=200_50
But the image file name doesn't change. How can be add hash/chunk to the file name with ipx so the file will not be cached after a new deploy.
Example: /_ipx/images/homepage/top-slider/logo-colipays-bordeaux-gris..19dm102lf.png?fit=fill&s=200_50
It would be very interesting to be able to do this in order to cache images longer (#329).
I have found a way to do it but it's really overkill... For now, my issue is fixed but i'm open to a any more easy methods.
@ghostlexly how did you accomplish adding a hash?
I have found a way to do it but it's really overkill... For now, my issue is fixed but i'm open to a any more easy methods.
@ghostlexly can you share any details on the approach that you took?
It's really frustrating when someone says they found a solution and just vanish without sharing it with others.
It's really frustating that this isn't supported in the first place..
In the Nuxt2 version of this plugin, there is a staticFilename
configuration that supports hash. However, it seems that this configuration is no longer available in the new version.
Supporting hash is essential. Someone should take care of implementing it asap.
Sorry for my late reply, I do not receive notifications on GitHub. If anyone comes across this and is looking for the solution, here it is:
export default {
image: {
// Generate images to `/_nuxt/image/file.png`
staticFilename: '[publicPath]/images/[name]-[hash][ext]'
}
}
Sorry for my late reply, I do not receive notifications on GitHub. If anyone comes across this and is looking for the solution, here it is:
export default { image: { // Generate images to `/_nuxt/image/file.png` staticFilename: '[publicPath]/images/[name]-[hash][ext]' } }
Hi,
As @Red-Asuka already pointed above:
There's no such a property for Nuxt3: https://image.nuxt.com/get-started/configuration
staticFilename
is only available in the previous versions of Nuxt Image, the ones compatible with Nuxt2: https://v0.image.nuxtjs.org/api/options#staticfilename
Sorry for my late reply, I do not receive notifications on GitHub. If anyone comes across this and is looking for the solution, here it is:
export default { image: { // Generate images to `/_nuxt/image/file.png` staticFilename: '[publicPath]/images/[name]-[hash][ext]' } }
Hi, As @Red-Asuka already pointed above: There's no such a property for Nuxt3: https://image.nuxt.com/get-started/configuration
staticFilename
is only available in the previous versions of Nuxt Image, the ones compatible with Nuxt2: https://v0.image.nuxtjs.org/api/options#staticfilename
You're right, my problem was on Nuxt2. I do not know the solution for Nuxt3.
Sorry for my late reply, I do not receive notifications on GitHub. If anyone comes across this and is looking for the solution, here it is:
export default { image: { // Generate images to `/_nuxt/image/file.png` staticFilename: '[publicPath]/images/[name]-[hash][ext]' } }
Hi, As @Red-Asuka already pointed above: There's no such a property for Nuxt3: https://image.nuxt.com/get-started/configuration
staticFilename
is only available in the previous versions of Nuxt Image, the ones compatible with Nuxt2: https://v0.image.nuxtjs.org/api/options#staticfilenameYou're right, my problem was on Nuxt2. I do not know the solution for Nuxt3.
There's no obvious solution for Nuxt3 until someone decides to release a new version of Nuxt Image that supports filename hashing (that to me seems an obvious feature btw and I'm a bit surprised to don't see it there by default as it could be).