Skip to content
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

Plugin greatly increases Eleventy startup time #87

Closed
autumnlansing opened this issue Apr 9, 2021 · 3 comments
Closed

Plugin greatly increases Eleventy startup time #87

autumnlansing opened this issue Apr 9, 2021 · 3 comments

Comments

@autumnlansing
Copy link

Use of this plugin has greatly increased start-up time for Eleventy. I've created four different shortcodes for use with different types of images on a site, and my start-up time has increased from a few seconds to almost five minutes. This occurs with both async and sync functions.

Eleventy takes forever to write files when it starts, whereas without this plugin it writes files immediately. This site is not a large one, only about 20 pages and 24 images. Once Eleventy has built the site after startup, however, it runs normally. Post-startup builds happen in a few seconds. It's only at startup that it seems to hang. Is there anyway to mitigate this problem?

@autumnlansing
Copy link
Author

Having had a chance to spend some time on this over the weekend, I see that the plugin is rebuilding every single image when Eleventy starts, and there doesn't seem to be any way around it. Removing a source image causes the build to fail. The source image has to be there, and the plugin will rebuild each image every time it starts, as it only has an in-memory cache. That can turn into a huge cost of time for any site with more than a few images. A possible solution would be to implement a persistent cache, perhaps in the form of a json file.

@Princesseuh
Copy link

Princesseuh commented Apr 12, 2021

An issue about this has already been posted before #51 :)

@autumnlansing
Copy link
Author

Yes, thank you. I didn't see that issue when I first opened this one, as the title didn't seem similar enough to what I thought was wrong. I'll close this one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants