Skip to content

Commit b05885e

Browse files
committed
✨ Disable cache for redirects - fixes #114
1 parent 277cc91 commit b05885e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- The web browser code doesn't check for Xorg anymore, just display variables (#93)
2020
- Bookmarks can be made to non-gemini URLs (#94)
2121
- Remove pointless directory fallbacks (#101)
22+
- Don't load page from cache when redirected to it (#114)
2223

2324
### Fixed
2425
- XDG user dir file is parsed instead of looking for XDG env vars (#97, #100)

display/private.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,14 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) {
383383

384384
// Gemini URL, or one with a Gemini proxy available
385385

386-
// Load page from cache if possible
387-
page, ok := cache.GetPage(u)
388-
if ok {
389-
setPage(t, page)
390-
return ret(u, true)
386+
// Load page from cache if it exists,
387+
// and this isn't a page that was redirected to by the server (indicates dynamic content)
388+
if numRedirects == 0 {
389+
page, ok := cache.GetPage(u)
390+
if ok {
391+
setPage(t, page)
392+
return ret(u, true)
393+
}
391394
}
392395
// Otherwise download it
393396
bottomBar.SetText("Loading...")

0 commit comments

Comments
 (0)