Cache also request query parameters

This commit is contained in:
Felipe M 2021-03-10 12:07:32 +01:00
parent 5c6918e3ce
commit 1903bfe3e1
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
1 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,8 @@ func getCachePath(mangadexURL *url.URL) string {
// getCacheFilename generates a cache filename based on the URL of the request
// TODO: Use query arguments as well
func getCacheFilename(mangadexURL *url.URL) string {
return strings.ReplaceAll(mangadexURL.Path, "/", "_")
filename := strings.ReplaceAll(mangadexURL.Path, "/", "_")
return filename + strings.ReplaceAll(mangadexURL.Query().Encode(), "&", "-")
}
// cacheExists checks that the cache for a certain URL exists or not