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

Persist cache in Netlify #115

Closed
zeroby0 opened this issue Jul 19, 2021 · 1 comment · Fixed by #116
Closed

Persist cache in Netlify #115

zeroby0 opened this issue Jul 19, 2021 · 1 comment · Fixed by #116

Comments

@zeroby0
Copy link
Contributor

zeroby0 commented Jul 19, 2021

Just like #51, but in Netlify cache.

It seems you can manage Netlify's cache only via a Netlify plugin, but to build such a plugin, co-operation from this plugin is necessary. Specifically,

  • A way to find out the output directory
  • And more importantly, it would require this plugin to not process an image if the processed image file is already in the outputDir
  • Include the options.sharpOptions in calculating the image hash

Then creating a Netlify plugin would be as simple as:

  • Copy files in _site/img after build
  • Restore files from cache to _site/img before build

Unless there is a reason to not re-use files in _site/img, can we please do this? :)

Edit: Wait, I think this would solve #51 too! Okay, I'm gonna start work on it.
Edit: It's done, I'll start PR in a few minutes if everything is okay.

@zeroby0
Copy link
Contributor Author

zeroby0 commented Jul 20, 2021

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

Successfully merging a pull request may close this issue.

1 participant