Closed ohbob closed 1 year ago
Yes. Set a cache rule on your server.
Yes. Set a cache rule on your server.
Could you give an example please?
If your using something like next.js and next/image, there is some cache settings to be set there: In next.config.js you can set the images cache duration. If you have no cache on the server, and haven't set minimumCacheTTL, then you images will get thrown away as soon as they have been generated.
https://nextjs.org/docs/api-reference/next/image#caching-behavior
do i understand this right, the caching is happening on the client side for the front end? If that's the case, seems a bit odd, that it's not being cached at backend..
Oh sorry, mixed together this issue with a next/image thread I'm getting a lot of updates on. Edited.
But I would recommending using a cache layer in front of this plugin. Wouldn't not expect that's in the scope of this plugin, it has just a single purpose, to generate an images based on the parameters I send to it. See it like a microservice. Cause caching all depends on the rest of the setup in your project. If your using something like Gatsby or Next.js, it will be build into the framework.
it has just a single purpose, to generate an images based on the parameters I send to it
The generated image is not saved in the filesystem, am I right?
Thanks
You can now set maxAge
properly in the plugin setting.
Before v1.2.0
this setting were not used by ipx, it was fixed on https://github.com/unjs/ipx/pull/71 so browser cache should now work as expected!
About server side caching, for now images are not stored anywhere. We can extend https://github.com/strapi-community/strapi-plugin-rest-cache to allow caching assets?
please extend serverside caching of images
+1 is this something planned in the future?
You can now set
maxAge
properly in the plugin setting. Beforev1.2.0
this setting were not used by ipx, it was fixed on https://github.com/unjs/ipx/pull/71 so browser cache should now work as expected!About server side caching, for now images are not stored anywhere. We can extend https://github.com/strapi-community/strapi-plugin-rest-cache to allow caching assets?
Any progress on this? I really want this to become a reality) how can I help?
I do not have too much time to work on this at now, sorry! If someone could open a PR I will take time to review/publish, that would be appreciated.
Hello there!
The feature is done in v1.4.0
: https://strapi-community.github.io/strapi-plugin-local-image-sharp/guide/#configuration
Also, the new documentation is online! Feedback is welcome!
How do you manage when you change the image? because the reiszed images are cached and not change. How can i flush that specific image cache?
Is there a way once requested the image is being cached forever? I don't want to regenerate the image on each call.