Skip to content

Commit

Permalink
✨ Disable cache for redirects - fixes #114
Browse files Browse the repository at this point in the history
  • Loading branch information
makew0rld committed Nov 5, 2020
1 parent 277cc91 commit b05885e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The web browser code doesn't check for Xorg anymore, just display variables (#93)
- Bookmarks can be made to non-gemini URLs (#94)
- Remove pointless directory fallbacks (#101)
- Don't load page from cache when redirected to it (#114)

### Fixed
- XDG user dir file is parsed instead of looking for XDG env vars (#97, #100)
Expand Down
13 changes: 8 additions & 5 deletions display/private.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,14 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) {

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

// Load page from cache if possible
page, ok := cache.GetPage(u)
if ok {
setPage(t, page)
return ret(u, true)
// Load page from cache if it exists,
// and this isn't a page that was redirected to by the server (indicates dynamic content)
if numRedirects == 0 {
page, ok := cache.GetPage(u)
if ok {
setPage(t, page)
return ret(u, true)
}
}
// Otherwise download it
bottomBar.SetText("Loading...")
Expand Down

0 comments on commit b05885e

Please sign in to comment.