Open ehmicky opened 4 years ago
Image processing can be quite slow.
It would be great if the minified images could be cached, so minification does not happen on the next build if the image has not changed.
For example:
{publishDir}/image.png
{publishDir}/image-{hash}.png
hash
cache.save('{publishDir}/image-{hash}.png')
cache
cache.restore('{publishDir}/image-{hash}.png')
true
What do you think?
Image processing can be quite slow.
It would be great if the minified images could be cached, so minification does not happen on the next build if the image has not changed.
For example:
{publishDir}/image.png
is found{publishDir}/image-{hash}.png
, wherehash
is the file's content hashcache.save('{publishDir}/image-{hash}.png')
is called (seecache
utility documentation here)cache.restore('{publishDir}/image-{hash}.png')
is called. If it returnstrue
, that file does not need to be minified again{publishDir}/image-{hash}.png
is finally moved to{publishDir}/image.png
What do you think?