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

NonValidatingImageCacheBackend and cache invalidation #145

Closed
dmishe opened this issue Aug 17, 2012 · 2 comments
Closed

NonValidatingImageCacheBackend and cache invalidation #145

dmishe opened this issue Aug 17, 2012 · 2 comments

Comments

@dmishe
Copy link

dmishe commented Aug 17, 2012

It seems that if I use NonValidatingImageCacheBackend then management commands ikcache* do exactly nothing to generate new files. It kind of makes sense, given the purpose of the backend, but in some cases I would like to invalidate and then force generate caches for this backend.

@semente
Copy link

semente commented Oct 30, 2012

I use the following management command to generate new files:

from django.core.management.base import BaseCommand

from galeria.models import Picture


class Command(BaseCommand):
    help = "Generate thumbnails of galeria's pictures."

    def handle(self, *args, **options):
        for p in Picture.objects.public():
            name = p.display_image.name
            storage = p.display_image.source_file.storage
            if name and not storage.exists(name):
                p.display_image.generate(save=True)
                p.thumbnail_image.generate(save=True)
                p.cover_image.generate(save=True)

@matthewwithanm
Copy link
Owner

I think IK3 (now in the development branch) addresses this, so I'm going to close it. I realize that the NonValidatingImageCacheBackend ended up being kind of kludgy, but I think what you might be looking for is the --force-revalidation flag.

Hopefully IK3—which allows you to specify actions on particular events (source_changed, etc.)—will solve your problem more gracefully.

I'd be very interested in hearing your thoughts about it. Sorry the response was so slow in coming!

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

3 participants