Logo Search packages:      
Sourcecode: zope-cachefu version File versions  Download package

def CacheSetup::content::cache_tool::CacheTool::getUrlsToPurge (   self,
  object 
)

Get a list of URLs to be purged when the given object is added / modified / deleted

Definition at line 446 of file cache_tool.py.

00446                                     :
        """Get a list of URLs to be purged when the given object is added / modified / deleted"""

        # if nothing to purge, return an empty list
        if not self.hasPurgeableProxy():
            return []
        
        relative_urls = sets.Set()
        rules = self.getRules().objectValues()
        for rule in rules:
            try:
                rule.getRelativeUrlsToPurge(object, relative_urls)
            except ConflictError:
                raise
            except:
                log_exc()
        relative_urls = list(relative_urls)
        if relative_urls:
            if self.getCacheConfig() == 'squid_behind_apache':
                # assumes urls passed to squid by apache take the form
                # SQUID_URL/PROTOCOL/HOST/PORT/PATH
                domains = self.getDomains()
                prefixes = []
                for d in domains:
                    p = urlparse.urlparse(d)
                    protocol = p[0]
                    host = p[1]
                    split_host = host.split(':')
                    host = split_host[0]
                    port = split_host[1]
                    prefixes.append('%s/%s/%s/' % (protocol, host, port))
                relative_urls = [prefix+url for prefix in prefixes \
                                            for url in relative_urls]
        return relative_urls

    # A few helper methods
    
    def getMember(self):


Generated by  Doxygen 1.6.0   Back to index