-
Notifications
You must be signed in to change notification settings - Fork 26
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 eleventy_img generated images #99
Cache eleventy_img generated images #99
Conversation
This is awesome, thanks again! I'll test this thoroughly, but I may hold off on merging until your PR to the Eleventy image plugin gets reviewed, just to be on the safe side. |
Glad you like it! :D I hope it gets reviewed soon. It's a pretty simple change though, it's puzzling how no one has reviewed it yet. I should probably make a tool to make the review easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question! Gonna also test this locally when I get a chance; the Netlify deploy preview looks good 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good locally!
I didn't notice a change in local build times; it's definitely faster on Netlify, though.
Even on rebuilds? |
Yeah, rebuild took around 90 seconds total (which is typical for this site locally). My laptop is likely slower than yours, lol. |
That's interesting.. As long as the Here is what I ran on linux: git clone https://github.com/zeroby0/aleksandrhovhannisyan.com.git
git checkout cache
yarn
yarn run build # 42.6 seconds
yarn run build # 10.3 seconds |
f8e1dd6
to
fcb636e
Compare
Sorry for the delayed response—I'm on Windows (WSL), so that's likely the issue. The good news is that the local builds aren't slower, and if I ever get a better dev setup going, they'll be faster 😄 |
Maybe, I'll don't have a windows machine around, but I'll try to see it in a VM in the weekend. Also, the PR is under review and I'm so excited! |
I noticed! They even tweeted about it 😄 |
4ca4e73
to
33846e5
Compare
@AleksandrHovhannisyan I tested it directly without wsl, and that worked as expected. Will test wsl now. |
@zeroby0 I'm actually running WSL1 like a scrub. (My project is in a Windows dir, so WSL1 is technically faster than 2 for me) |
Smart choice! So I tried wsl1, wsl2, and bare windows on a VM. time npm run build # No cache
real 2m37.072s
user 1m37.547s
sys 0m35.422s
time npm run build # Second run, so images are in cache
real 0m56.767s
user 0m21.453s
sys 0m18.406s So I still have no idea why it isn't working, unfortunately 😂 Can you run this and see if the cache doesn't work there too: https://github.com/zeroby0/demo-eleventy-img-cache |
Sure! I'll give it a shot when I get a chance. |
3730cf4
to
a471e3f
Compare
@zeroby0 Wow I'm dumb 😅 I was testing without doing a 18 seconds now! Amazing stuff—will follow the 11ty PR closely and then we can point this PR to the plugin. |
Haha, happens 😄 I do that sometimes too 😂 TIL about the postcheckout git hook! :D Can't believe it's been a month since we started this PR, seems like yesterday! 😄 |
@zeroby0 Right? I'm excited to merge this! When you get a chance, could you update the branch to point to the 11ty image |
Done! :D But you should probably wait for the second beta before merging if you're using remote URLs: 11ty/eleventy-img#123 |
Nope, no remote URLs yet (I may support them in the future though) |
Works great, thanks again! |
Adds filesystem caching of images generated by eleventy_img to speed up build time. Cache is persisted locally and on Netlify.
Serve time is the time from running
yarn run serve
and content being available onlocalhost:4001
.Read more at:
If this is merged, I'll notify here when 116 is merged. All the images look okay in local testing, but please test when merging.
Thank you for opensourcing your website, it was very helpful in verifying that the patch is error-less. Here is a PR as a token of gratitude :)