pbre
Forum Replies Created
-
Edit: My workaround is limited due to the 5 condition rules restriction…
Forum: Plugins
In reply to: [LiteSpeed Cache] PHP Notice: Array to string conversionto be correct @qtwrk it’s PHP 7.4.30
Forum: Plugins
In reply to: [LiteSpeed Cache] PHP Notice: Array to string conversionPHP 7.4
WP 6.0.2Forum: Plugins
In reply to: [CAOS | Host Google Analytics Locally] Compatibility with PixelYourSite@alpha966123 have you tried to flush/purge your serverside/onsite cache?
Thanks @johnny5
regarding
1) okay, thanks!
2) Any existing rules will remain – sure.
Would the plugin automatically replace the rules from the DB and write it to the htaccess file and afterewards delete the rules from the DB?
3) Found one: On some OLS servers you have to reboot the server or restart LSWS https://www.basezap.com/htaccess-changes-openlitespeed-web-server/Forum: Plugins
In reply to: [LiteSpeed Cache] LiteSpeed Crawler: Cookie Notice – QuestionQuestion on top of the discussed above:
Can I ouput ONE cached page if two cookies are set?
For example:
I want to be extra sure about the cookiesCookieLawInfoConsent viewed_cookie_policy–> If BOTH cookies are set, then output ONE cached version
((These are just imagined rules, not real rules! – for those who came here from Google for copy and pasting stuff)) – so something like:
RewriteRule .* - [E="cache-vary:CookieLawInfoConsent + viewed_cookie_policy"]
or
RewriteRule .* - [E="cache-vary:CookieLawInfoConsent && viewed_cookie_policy"]Forum: Plugins
In reply to: [LiteSpeed Cache] LiteSpeed Crawler: Cookie Notice – QuestionTo sum it up:
1) The comma is for multiple cookies – clear, thanks! ✅
2) Cookies likeCookieLawInfoConsentare case sensitive so it’s NOTRewriteRule .* - [E=Cache-Vary:cookielawinfoconsent]
it is
RewriteRule .* - [E=Cache-Vary:CookieLawInfoConsent]And:
RewriteRule .* - [E=cache-vary:xxx]can also be written likeRewriteRule .* - [E=Cache-Vary:xxx]✅
3) The shortRewriteRule .* - [E="cache-vary:xf_style_id,xf_language_id"]
is equal to / is technically the same likeRewriteRule .* - [E=cache-vary:xf_style_id] RewriteRule .* - [E=cache-vary:xf_language_id]Both rulesets create a different cashed page depending on the set cookie and the cookie value. ✅
So far correct?
An addon question regarding OLS and cache-vary:
In OpenLiteSpeed, is it enough to edit the .htaccess or do I have to edit the Headers as well?Have you tried to check
– to clear the cache after changes?
– used private mode with 3rd party cookies accepted without adblocking / PiHole / DNS / VPN with adblocking features?
– whether you or one of your collegues have excluded that cookie?
– if the cookie is set while disable all features or disable the LS Plugin?don’t know if this fits in this case… tried to vary the cache?
https://docs.litespeedtech.com/lscache/devguide/advanced/Forum: Plugins
In reply to: [LiteSpeed Cache] LiteSpeed Crawler: Cookie Notice – QuestionOkay, understood.
Thanks again @qtwrk ! 🙂Regarding the “comma rule”, I found it inside the docs as well at the second example, but the rule
– is inside quotation marks
– is written lower case, like the word combinationcache-var
– isn’t documented indepth what it does (like: “Only if a and b matches, than cache the page.” Or “If a OR b matches, then cache the page”…)
https://docs.litespeedtech.com/lscache/devguide/advanced/#rewrite-rulesWould you mind to ask your team about that?
An addon question regarding OLS and cache-vary:
In OpenLiteSpeed, is it enough to edit the .htaccess or do I have to edit the Headers as well?Forum: Plugins
In reply to: [LiteSpeed Cache] LiteSpeed Crawler: Cookie Notice – QuestionThanks again @qtwrk that you enlighten me with your wisdom 🙂
Let’s say I would create a one-for-all htaccess file with a collection of Cookie/Cache-Vary and there are cookies inside the htaccess that would never be used.
Would this have a negative impact on speed/stability, cache hits and/or would this result into errors?The logic behind this is to safe time and redundant work to not scan every site moved to LiteSpeed for the corresponding cookie.
Thanks @qtwrk !
I Would appreciate if you would add this to the KB or the standard .htaccess 🙂Something like:
# ADD YOUR CUSTOM RULES HERE (LIKE CACHE-VARY) ## HAVE A LOOK AT THE DOCS: https://docs.litespeedtech.com/lscache/devguide/advanced/ <IfModule LiteSpeed> RewriteEngine On # YOUR RULE HERE </IfModule> <IfModule LiteSpeed> # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## <IfModule LiteSpeed> RewriteEngine on CacheLookup on RewriteRule .* - [E=Cache-Control:no-autoflush] RewriteRule \.litespeed_conf\.dat - [F,L] ... </IfModule>- This reply was modified 3 years, 8 months ago by pbre.
Forum: Plugins
In reply to: [LiteSpeed Cache] LiteSpeed Crawler: Cookie Notice – QuestionBased on the questions above:
If I vary a cookie
1. Is the rule for the cookie nane case-sensitive? like
RewriteRule .* - [E=Cache-Vary:CookieLawInfoConsent]
or
RewriteRule .* - [E=Cache-Vary:cookielawinfoconsent]
2. Is there a way to visually “see” and/or check the results of a vary rule like a screenshot of a page?
3. What does the comma do? I saw it here: https://github.com/WpSpeedDoctor/litespeed-cookie-based-caching/blob/main/htaccess.txt (line 23)
is it like AND / OR / XOR?- This reply was modified 3 years, 8 months ago by pbre.
Forum: Plugins
In reply to: [LiteSpeed Cache] LiteSpeed Crawler: Cookie Notice – QuestionHi @qtwrk
The site’s using the Plugin GDPR Cookie Consent
https://wordpress.org/plugins/cookie-law-info/The Cookie following cookies gets pre-set from this plugin on a pageview:
cookielawinfo-checkbox-non-necessary cookielawinfo-checkbox-necessaryThis cookie will be set after accepting the Cookie Consent:
CookieLawInfoConsent viewed_cookie_policy1. So to vary the cookie and cache different sites “states” based on cookies it would be like this inside the .htaccess file, right?:
<IfModule LiteSpeed> RewriteEngine On RewriteRule .* - [E=CookieLawInfoConsent] RewriteRule .* - [E=viewed_cookie_policy] </IfModule>2. Is the order of the loaded Cookies important?
3. Can I shorten the cookie string like this to eliminate a line (or what does the comma do)?
RewriteRule .* - [E=CookieLawInfoConsent,viewed_cookie_policy]Thanks for your help @qtwrk ! I really appreciate it 🙂
One short question – just to be sure:
There will be not conflicts of having two<IfModule LiteSpeed>...</IfModule>brackets and/or LiteSpeed won’t delete the custom lines, right?So it would be on top of the .htaccess, right?
<IfModule LiteSpeed> RewriteEngine On RewriteRule .* - [E=Cache-Vary:woocommerce_current_currency] RewriteRule .* - [E=Cache-Vary:wp-wpml_current_language] </IfModule>and afterwards comes the standard LiteSpeed rules
<IfModule LiteSpeed> # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## <IfModule LiteSpeed> RewriteEngine on CacheLookup on RewriteRule .* - [E=Cache-Control:no-autoflush] RewriteRule \.litespeed_conf\.dat - [F,L] ... </IfModule>So it would be
<IfModule LiteSpeed> RewriteEngine On RewriteRule .* - [E=Cache-Vary:woocommerce_current_currency] RewriteRule .* - [E=Cache-Vary:wp-wpml_current_language] </IfModule> <IfModule LiteSpeed> # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## <IfModule LiteSpeed> RewriteEngine on CacheLookup on RewriteRule .* - [E=Cache-Control:no-autoflush] RewriteRule \.litespeed_conf\.dat - [F,L] ... </IfModule>Correct?
- This reply was modified 3 years, 8 months ago by pbre.