adjust cache keys

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1704 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-09-03 13:30:24 +00:00
parent 6808d69ed1
commit c79581fe31
2 changed files with 14 additions and 1 deletions

View file

@ -99,6 +99,19 @@ class FileUrl (urlbase.UrlBase):
self.has_content = True
return self.data
def set_cache_keys (self):
"""Set keys for URL checking and content recursion."""
# removed anchor from content cache key
self.cache_content_key = self.url
# construct cache key
if self.consumer.config["anchorcaching"]:
# do not ignore anchor
self.cache_url_key = \
urlparse.urlunsplit(self.urlparts[:4]+[self.anchor])
else:
# no anchor caching
self.cache_url_key = self.url
def is_html (self):
if linkcheck.checker.extensions['html'].search(self.url):
return True

View file

@ -4,7 +4,7 @@ real url file://%(curdir)s/linkcheck/ftests/data/anchor.html
valid
url '#myid'
cache key file://%(curdir)s/linkcheck/ftests/data/anchor.html
cache key file://%(curdir)s/linkcheck/ftests/data/anchor.html#myid
real url file://%(curdir)s/linkcheck/ftests/data/anchor.html
name Bla
valid