diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea692c..3a68e2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bottom bar now says `URL/Num./Search: ` when space is pressed - Update to [go-gemini](https://github.com/makeworld-the-better-one/go-gemini) v0.6.0 - Help layout doesn't have borders anymore +- Pages with query strings are still cached (#29) +- URLs or searches typed in the bottom bar are not loaded from the cache (#29) ### Fixed - Actual unicode bullet symbol is used for lists: U+2022 diff --git a/cache/cache.go b/cache/cache.go index 6710260..4bc092f 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -3,7 +3,6 @@ package cache import ( - "net/url" "strings" "sync" @@ -52,11 +51,6 @@ func Add(p *structs.Page) { // Just in case, these pages shouldn't be cached return } - // Never cache pages with query strings, to reduce unexpected behaviour - parsed, err := url.Parse(p.Url) - if err == nil && parsed.RawQuery != "" { - return - } if p.Size() > maxSize && maxSize > 0 { // This page can never be added diff --git a/display/display.go b/display/display.go index cb4b118..2b728d5 100644 --- a/display/display.go +++ b/display/display.go @@ -172,9 +172,12 @@ func Init() { // It's a full URL or search term // Detect if it's a search or URL if strings.Contains(query, " ") || (!strings.Contains(query, "//") && !strings.Contains(query, ".") && !strings.HasPrefix(query, "about:")) { - URL(viper.GetString("a-general.search") + "?" + pathEscape(query)) + u := viper.GetString("a-general.search") + "?" + pathEscape(query) + cache.Remove(u) // Don't use the cached version of the search + URL(u) } else { // Full URL + cache.Remove(query) // Don't use cached version for manually entered URL URL(query) } return