From 5f46e580a36491da8bde5208aefe59189b52ec66 Mon Sep 17 00:00:00 2001 From: saturn Date: Fri, 26 Apr 2024 01:38:48 -0500 Subject: [PATCH] Don't revalidate for low-priority bots. --- lw2.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lw2.lisp b/lw2.lisp index 0235543e..b4d2c74b 100644 --- a/lw2.lisp +++ b/lw2.lisp @@ -766,7 +766,10 @@ (let* ((*current-prefs* (safe-decode-json (hunchentoot:cookie-in "prefs"))) (*preview* (string-equal (hunchentoot:get-parameter "format") "preview"))) (multiple-value-bind (*revalidate-default* *force-revalidate-default*) - (cond ((ppcre:scan "(?:^|,?)\\s*(?:no-cache|max-age=0)(?:$|,)" (hunchentoot:header-in* :cache-control)) + (cond ((ppcre:scan "GPTBot|ClaudeBot|GoogleOther|AmazonBot|facebookexternalhit" (hunchentoot:header-in* :user-agent)) + ;; Low priority bots + (values nil nil)) + ((ppcre:scan "(?:^|,?)\\s*(?:no-cache|max-age=0)(?:$|,)" (hunchentoot:header-in* :cache-control)) (values t t)) (*preview* (values nil nil)) -- 2.11.4.GIT