Giter Site home page Giter Site logo

Comments (15)

stafyniaksacha avatar stafyniaksacha commented on June 12, 2024 1

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!

from strapi-plugin-local-image-sharp.

Sandstedt avatar Sandstedt commented on June 12, 2024

Yes. Set a cache rule on your server.

from strapi-plugin-local-image-sharp.

ohbob avatar ohbob commented on June 12, 2024

Yes. Set a cache rule on your server.

Could you give an example please?

from strapi-plugin-local-image-sharp.

Sandstedt avatar Sandstedt commented on June 12, 2024

Ngnix:
https://linuxhint.com/cache-static-resources-https-nginx/

Apache:
https://www.faqforge.com/linux/enable-image-caching-in-apache-for-better-google-page-speed-results/

from strapi-plugin-local-image-sharp.

Sandstedt avatar Sandstedt commented on June 12, 2024

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

from strapi-plugin-local-image-sharp.

ohbob avatar ohbob commented on June 12, 2024

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..

from strapi-plugin-local-image-sharp.

Sandstedt avatar Sandstedt commented on June 12, 2024

Oh sorry, mixed together this issue with a next/image thread I'm getting a lot of updates on. Edited.

from strapi-plugin-local-image-sharp.

Sandstedt avatar Sandstedt commented on June 12, 2024

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.

from strapi-plugin-local-image-sharp.

c3s4 avatar c3s4 commented on June 12, 2024

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

from strapi-plugin-local-image-sharp.

stafyniaksacha avatar stafyniaksacha commented on June 12, 2024

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 unjs/ipx#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?

from strapi-plugin-local-image-sharp.

ohbob avatar ohbob commented on June 12, 2024

please extend serverside caching of images

from strapi-plugin-local-image-sharp.

kevin-chassagne avatar kevin-chassagne commented on June 12, 2024

+1 is this something planned in the future?

from strapi-plugin-local-image-sharp.

ohbob avatar ohbob commented on June 12, 2024

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 unjs/ipx#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?

from strapi-plugin-local-image-sharp.

stafyniaksacha avatar stafyniaksacha commented on June 12, 2024

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.

from strapi-plugin-local-image-sharp.

martin-landhi avatar martin-landhi commented on June 12, 2024

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?

from strapi-plugin-local-image-sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.