browser: only use cache when going back

This commit is contained in:
dece 2021-05-14 23:15:22 +02:00
parent 62997b9385
commit 09f660feaf
3 changed files with 3 additions and 5 deletions

View file

@ -30,7 +30,6 @@ click on links to open them
bug: can't reload bebop: pages bug: can't reload bebop: pages
bug: exiting editor breaks curses bug: exiting editor breaks curses
dumb rendering mode per site dumb rendering mode per site
disable cache per site
well, preferences per site maybe? well, preferences per site maybe?
download without memory buffer download without memory buffer
download in the background download in the background

View file

@ -317,7 +317,7 @@ class Browser:
return result return result
def open_url(self, url, base_url=None, redirects=0, assume_absolute=False, def open_url(self, url, base_url=None, redirects=0, assume_absolute=False,
history=True, use_cache=True): history=True, use_cache=False):
"""Try to open an URL. """Try to open an URL.
This function assumes that the URL can be from an user and thus tries a This function assumes that the URL can be from an user and thus tries a
@ -516,7 +516,7 @@ class Browser:
else: else:
previous_url = self.history.get_previous() previous_url = self.history.get_previous()
if previous_url: if previous_url:
self.open_url(previous_url, history=False) self.open_url(previous_url, history=False, use_cache=True)
def go_to_parent_page(self): def go_to_parent_page(self):
"""Go to the parent URL if possible.""" """Go to the parent URL if possible."""

View file

@ -26,7 +26,7 @@ def open_gemini_url(
browser: Browser, browser: Browser,
url: str, url: str,
redirects: int =0, redirects: int =0,
use_cache: bool =True, use_cache: bool =False,
cert_and_key=None cert_and_key=None
) -> Optional[str]: ) -> Optional[str]:
"""Open a Gemini URL and set the formatted response as content. """Open a Gemini URL and set the formatted response as content.
@ -314,7 +314,6 @@ def _handle_cert_required(
browser, browser,
url, url,
redirects=redirects + 1, redirects=redirects + 1,
use_cache=False,
cert_and_key=(cert_path, key_path) cert_and_key=(cert_path, key_path)
) )