Use static values to determine the `spiderID`
authorAlexander Ebert <ebert@woltlab.com>
Sun, 27 Feb 2022 13:50:49 +0000 (14:50 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 27 Feb 2022 13:50:49 +0000 (14:50 +0100)
The `spiderID` can never be set for logged-in users and for guests this value is tracked in the legacy session for now.

This prevents the loading and processing of the chunky spider cache for most requests.

wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index dc04445c4aa2978529079677bd4287f06eabe8ab..21dd6ff7a37af90d679c585ddadc33bfd3b98947 100644 (file)
@@ -161,7 +161,11 @@ final class SessionHandler extends SingletonFactory
             case 'userID':
                 return $this->user->userID;
             case 'spiderID':
-                return $this->getSpiderID(UserUtil::getUserAgent());
+                if ($this->userID) {
+                    return null;
+                }
+
+                return $this->legacySession->spiderID;
             case 'pageID':
             case 'pageObjectID':
             case 'parentPageID':