Skip to content
Snippets Groups Projects
cache.py 326 B
Newer Older
  • Learn to ignore specific revisions
  • Todd Dembrey's avatar
    Todd Dembrey committed
    from django.conf import settings
    
    from wagtail.contrib.frontend_cache.utils import purge_url_from_cache
    from wagtail.core.models import Site
    
    Todd Dembrey's avatar
    Todd Dembrey committed
    
    
    def purge_cache_on_all_sites(path):
        if settings.DEBUG:
            return
    
        for site in Site.objects.all():
            purge_url_from_cache('%s%s' % (site.root_url.rstrip('/'), path))