So, I've been tinkering with a basic firewall plugin and today I stumbled upon a problem. Caching. I had forgotten that I had LightSpeed cache installed one one of my test sites and went to work on my plugin. I set it up to error log some details for me and started trying to load the site's main page. A hour later after dozens of refreshes and still not seeing any error log I remembered the cache. No matter what URI I plugged in the cache took complete control and basically disabled my plugin from even loading. First line in my plugin, create an entry in the error log... nothing. The instant I disabled the cache, I had error logs.
The only time LightSpeed allowed my plugin to even run was on the admin side. Not on the public side.
So, here's the question. If you were planning to write some plugin that grabs the incoming URI or IP or user agent and do something with it, how the hell could you expect it to work if these caching plugins completely bypass and essentially disable your plugin anyway?
How could your plugin even detect these cache plugins if they refuse to even let it load and run? Ok, so you could start looking for directories and headers and such during your plugin activation, but assume they install the cache after your plugin. Then what?
I've attempted to hook into wp, init, plugins_loaded, muplugins_loaded and lightspeed is still managing to bypass my plugin.
So let's assume for whatever crazy reason, I wanted to block all IP's from TOR exit nodes. If the cache won't even let your plugin fire, how are you supposed to block the IP???