commit ba0f707669e5bdf8b9470f3cb758132fef2b788a
parent 67f9c662b3bde5e614a0e92ad14f37403aab5e99
Author: Solderpunk <solderpunk@sdf.org>
Date: Tue, 1 Sep 2020 23:27:59 +0200
Ignore the cache when reloading a page.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/av98.py b/av98.py
@@ -307,7 +307,7 @@ class GeminiClient(cmd.Cmd):
(hostname text, address text, fingerprint text,
first_seen date, last_seen date, count integer)""")
- def _go_to_gi(self, gi, update_hist=True, handle=True):
+ def _go_to_gi(self, gi, update_hist=True, check_cache=True, handle=True):
"""This method might be considered "the heart of AV-98".
Everything involved in fetching a gemini resource happens here:
sending the request over the network, parsing the response if
@@ -335,7 +335,7 @@ you'll be able to transparently follow links to Gopherspace!""")
return
# Use cache, or hit the network if resource is not cached
- if self.options["cache"] and self._is_cached(gi.url):
+ if check_cache and self.options["cache"] and self._is_cached(gi.url):
mime, body, tmpfile = self._get_cached(gi.url)
else:
try:
@@ -1235,7 +1235,7 @@ you'll be able to transparently follow links to Gopherspace!""")
@needs_gi
def do_reload(self, *args):
"""Reload the current URL."""
- self._go_to_gi(self.gi)
+ self._go_to_gi(self.gi, check_cache=False)
@needs_gi
def do_up(self, *args):