-
Notifications
You must be signed in to change notification settings - Fork 21
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
How to clear cache? #9
Comments
I think you've got two things here, one is the bug for how they were all the same image, and one is a feature request for how to force clear the cache. For the bug, can you paste your gulp-images proxy code for me to take a look at? For the feature, I think that's a good feature to have, gonna create a new issue for it. How do you feel about something like this: gulp.task('clearCache', function() {
// Still pass the files to clear cache for
gulp.src('./lib/*.js')
.pipe(cache.clear());
// Or, just call this for everything
cache.clearAll();
}); |
Absolutely! And thank you for a really fast response! I've removed irrelevant bits, but you can see this in full at: var cache = require('gulp-cache');
gulp.task('images', function() {
return gulp.src('app/assets/img/**/*')
.pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true })))
.pipe(livereload(server))
.pipe(gulp.dest('public/img'))
.pipe(notify({ message: 'images task complete' }));
}); |
Thanks, I'll clone it down and try to take a look this afternoon. |
Ran into something weird with the imagemin task. Looks like it is emitting data out of order, which I can fix. I just would like to have a unit test for it and I can't seem to make any of my stuff go out of order. |
Reported in #9 - Add check for same file before resolving the promise
Now published as 0.1.2 on NPM. Should work correctly with imagemin now. Thanks for the feedback and let me know if you find any other weird things. |
Figured I'd mention an issue I was having with I had two subdomains setup running the same repo with same NPM packages (all updated). One would generate optimized images, and one would not. My "images" task ran but the images were never output on that site. The only difference as far as I know is the failing site was initialized today. After simplifying the test case and setting up another site, I narrowed it down to Found this article: http://stackoverflow.com/questions/21532903/strange-images-issue-with-gulp-js Then rewrote using These were my versions:
And my task:
|
So I randomly had an issue when using the cache on images, where the gulp-images plugin would spit out the same image for all images, and after some debugging, this seemed to be related to gulp-cache. When I take caching out it works fine, but if I put the cache in, I get all the same image.
Anyways, I am guessing that clearing out this cache would solve it. Any suggestions on how to remove the cached items so image minification can go back to normal?
The text was updated successfully, but these errors were encountered: