Bug and suggestions
-
Hi!
I’m testing your plugin to control page caching based on the value of a specific cookie. I think I’ve found a bug and would like to submit a few suggestions.
The bug is as follows. When a cookie exclusion rule contains any of the special characters used to define a regular expression ( . \ + * ? [ ^ ] $ ( ) { } = ! < > | : – #) or the % character, the RewriteCond test generated in the .htaccess file is treated as a regular expression and this expression is sometimes syntactically incorrect, which causes Apache to crash. All these characters should in fact be escaped, as it is done in the corresponding PHP test for the same rule.
My suggestions are as follows. When testing cookie values to create an exclusion rule, currently we can only check whether the received cookies contain a certain string of characters. This is sometimes insufficient. It would be useful to also be able to define an exclusion:
- if the received cookies do not contain a certain string of characters,
- and, even better, if the received cookies match or do not match a specific regex.
For now, in my tests, I’m setting 5 exclusion rules for cookies, even though a single rule would suffice if I could use a regular expression. To work around the bug, I have to patch the generated .htaccess file to fix incorrect RewriteCond’s. And since caching is in my case based on cookie values, I don’t use the preload because exclusion rules based on cookie values do not seem to be checked by it (Right ?).
With all that done, the WP Fastest Cache plugin works great!
Thank you in advance for taking this message into consideration!
You must be logged in to reply to this topic.
