changeset 1375:e943b0c8eec5

pages: cache is skipped if there are query arguments in URL
author Goffi <goffi@goffi.org>
date Fri, 11 Dec 2020 17:35:06 +0100
parents 25104d31479f
children 1b94a5ab155f
files libervia/server/pages.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/server/pages.py	Fri Dec 11 17:35:03 2020 +0100
+++ b/libervia/server/pages.py	Fri Dec 11 17:35:06 2020 +0100
@@ -1029,6 +1029,11 @@
             #  we are not on the final page, no need to go further
             return
 
+        if request.uri != request.path:
+            # we don't cache page with query arguments as there can be a lot of variants
+            # influencing page results (e.g. search terms)
+            log.debug("ignoring cache due to query arguments")
+
         no_cache = request.getHeader('cache-control') == 'no-cache'
 
         profile = self.getProfile(request) or C.SERVICE_PROFILE