-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache generated images? #522
Comments
Would someone be able to try the caching plugin and let me know if it works this use case? vitejs/vite#10671 (see the "Try it" heading for instructions on setting it up) |
Hi! Vite team member here. |
Yeah we had on-disk caching in the 1.x version of this plugin (it was actually disk first) but maintaining that folder and purging old images was a total nightmare. |
Thanks for the update @ArnaudBarre. I know we decided not to merge anything in Vite core to deal with caching at the moment, but wasn't sure what thoughts were around it longer term - e.g. whether you might be maintaining the caching plugin or revisiting that approach if we find places where Vite still has opportunities for improvement. |
Yeah so regardless I kinda don't want to deal with implementing caching. I absolutely see the benefit but as I stated earlier last time around it was a nightmare. |
See vitejs/vite#14333, which implements a plugin hook for caching. Since we not only generate code for the file returned by |
Any update for this? I have 71 images and the build time is approximately 15 minutes. If I exclude them it's "just" 2 minutes. |
I'm using vite-imagetools in a SvelteKit project, and due to the many images that the site is using, creating a build takes almost 3 minutes. When I remove the vite-imagetools plugin, creating a build takes about 20 seconds. This is a huge huge difference, and it kind of doesn't make sense to me that the images are getting generated with every single build, as the source images basically never change.
Is there a way to cache the generated images, so that when you create the next build, it can just reuse the earlier generated images instead of having to create them all over again?
The text was updated successfully, but these errors were encountered: