Open KaragiannidesAgapios opened 3 years ago
Hi @KaragiannidesAgapios. Thanks for the issue.
Since runtime transforms are not hashed, they should be cached in a way next deployment can invalidate them with low TTL (updating hero.jpeg
being applied). We can expose maxAge
module option to (ipx) (default is 5 minutes) but I think this enhancement should be coupled with another addition to add a build hash to generates sources (otherwise you should use distinct name to invalidate old images..)
Small update from my side here.
I updated the cache time for images in the server for a year so the result is I don't see the Lighthouse error anymore.
I added images inside assets
directory so i can benefit from webpack, but the problem is that images are not updated on build. One must clear his cache, in order to see the updated content.
Also i noticed that this is not happening when a native html <img/>
is used instead.
Do you guys have anything to propose here?
@pi0 have there been any developments on hash generation? We could really use asset fingerprinting here.
Me too, please update. My CSS background-image generated by $img has a Cache-Control: max-age=300, public, s-maxage=300. There should be a better handling of this in order to increase the cache time.
@pi0 Any progress with this?
Maybe we can help with this?
Versions
Hey everyone and thank you for this great package.
I'm facing an issue with Lighthouse extension of chrome and i cannot fix it.
Here is my image component from the code:
and here is the generated code:
My image is stored inside
static/img/insurance
directory. I tried to fix the issue by using therender
option innuxt.config
like this (but it didn't solve the issue):I also tried the use of
keep-alive
prop in my layout like this(but it didn't solve the issue):<Nuxt keep-alive />
My question is this one: Is there any way to set
maxAge
throughnuxt/image
configs? If not are there any plans of exposing the ability to do so?If there is another solution that you are aware please let know (or let me know how i can help with this).