How to exclude nonce from being cached?
-
Hi – I create crytographically random nonce value like follows:
add_filter("TOA_PLUGIN/nonce_scriptx", function ($_) {
if (!isset($GLOBALS["TOA_PLUGIN"]["nonce_scriptx"])) {
$GLOBALS["TOA_PLUGIN"]["nonce_scriptx"] = bin2hex(random_bytes(12));
}
return $GLOBALS["TOA_PLUGIN"]["nonce_scriptx"];
});I then add this value to my script and inline scripts. This works well. Every page has a different nonce.
But revisitung a page i notice, that the same nonce is shown in the csp header.
From this i conclude, that the nonce is statically cached.
Is there a way to exclude the nonce from being cached?
Regards Theop.s.: The nonce changes as it should, when revisiting a page with litespeed deactivated
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘How to exclude nonce from being cached?’ is closed to new replies.