403 responses are being cached by LiteSpeed
-
Hello,
Report number: OOUCBYSW
I am experiencing an issue with 403 responses being cached when I don’t want them to be. This is happening across a wide range of sites with a variety of plugins and themes but the common factors are:
- LiteSpeed plugin is used for page caching
- WordFence plugin is used for dynamic access control (e.g to block spammers and hackers)
- CloudFlare is used for caching of static resources only – no page caching
In the LiteSpeed config the following settings have been set:
- 403 status code TTL is set to 0
- Serve Stale is off
- Guest mode is off
My issue appears to be the same as this issue that was raised two and half years ago. It can happen to any page that can be cached by LS and purging the 403 cache instantly fixes the problem.
Naturally, this is an intermittent issue that only arises when an abusive visitor is blocked by WordFence and the subsequent 403 response is then cached by LS. This response then gets served indiscriminately to site visitors. However, to confirm that these 403s are being cached by LS, please see the following server response headers.
I expected that setting 403 TTL to 0 would fix the issue, but it doesn’t seem to have worked. Are there any other settings I may have missed or could this be a bug?
Edit: the issue persists even when I circumvent CloudFlare by adding my server origin IP to my hosts file, so it is clearly not an issue with CF caching anything.
- This topic was modified 2 years, 10 months ago by .
- This topic was modified 2 years, 10 months ago by . Reason: Added further debug details
The page I need help with: [log in to see the link]
- The topic ‘403 responses are being cached by LiteSpeed’ is closed to new replies.