mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-20 14:20:59 +00:00
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:
parent
6808d69ed1
commit
c79581fe31
2 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue