How to avoid duplicating UCSS for each product pages




Wordpress LScache Plugin: How to avoid duplicating UCSS for each product pages


Of course, sometimes there are unique id for DOMs. But think all woocommerce products page will share almost same CSS. Is it neccessary generate it for each product page? Plus, I have set up the lazy load image exclude for my first image but PSI still says Largest Contentful Paint is lazy-loaded. You can check my setting here: https://ibb.co/PDHsb5B https://ibb.co/yWv8h4y Report number: VKRTCRGK The page I need help with: http://theryang.com One more question: I set 2 vary caches for CN and Other in .heaccess, respectively. RewriteEngine on RewriteRule . ? [E=Cache-Control:vary=other] #set default vary to other RewriteCond % HTTP:x-qc-country CN RewriteRule . ? [E=Cache-Control:vary=CN] In fact, I only need to vary cache for my homepage to redirect. Which I only need to create one more cache instead of create CN cache for every page (which uses up my quato everyday). Could you tell me how to set up it? Hi, when it comes to UCSS, where U stands for Unique , so yes , at current structure , it is one per page , even though if they are pretty much similar where did it say that ? for second question , you can add another check , make it like if page URL is / , and qc country header is CN , then vary best regards, OK. Please treat the first question as a request. For second one, I found its because WP 5.5 build-in lazy-load. I disable that and the PSI does not notice me about that again. For third one. I annotate the vary cache codes and superisely find that my ip-based redirect plugin still works when I switch visiting from CN and Other countries. Maybe litespeed does not cache the HTTP_X_CLIENT_IP hearder so that plugin can get correct ip each time? not sure about your redirection case bottom line is , you need to trigger the PHP to geoip it I use IP2Location Redirection plugin and I have checked there php code. They use $_SERVER[REMOTE_ADDR] or $_SERVER[HTTP_X_FORWARDED_FOR] to get the geo ip. I will keep testing if my case will still work without vary cache. no no , I mean like this I live in country A , you live in country B I access the page , the page is generated and cached where it shows me in country A then you visit it , despite you from B , it will still show A because it is cached already and wont trigger PHP to regenerate , thats where you need to have a vary to trigger the PHP again Yes. I understand what you mean. But the redirection still works for my website without vary cache. Thats why I say it superises me. You can test this link theryang.com if you have CN proxy If visitor is from CN, it will be redirected to /collection/ instead of home page. As I tested, it works everytime even though I switch my vpn to CN/non-CN each visiting. well , sadly I dont have proxy there ? OK. I will continue testing this in the future and discuss with you if it failed someday. Well. It does not work now?.. I think I still need to set up. How should I write this logical if page URL is / , and qc country header is CN , then vary otherwise other in .htaccess? If I only want to redirect my homepage to https://www.theryang.com/collection/. Do you think follow codes is a better way? RewriteEngine on RewriteCond % HTTP:x-qc-country CN RewriteCond % HTTP_HOST ^(?:www .)?theryang .com$ [NC] RewriteRule ^/?$ https://www.theryang.com/collection/ [R=301,L] In this way, I do not need to care about the vary cache and use Geoip plugin. maybe this enough? RewriteCond % HTTP:x-qc-country CN RewriteRule ^/?$ https://www.theryang.com/collection/ [R=301,L] rewrite rule is not exactly my best friend ? but it looks fine to me if you have server access, you can check the rewrite log , to see how exactly it was interpreted best regards, I do not what happen. It redirect every country to /collection now, even I purge litespeed and cdn cache, It seems as long as I visit from CN, my browsers cache it and redirect everytime even I switch back to SG. After clean the cache manually, it doesnt redirect me from SG. Ok. I change R=302 since 302 does not cache. Everythink works fine now .
Do you need help?
We are online almost any time and ready to answer any question. The answer to your question will come faster than it takes you to release the mouse button.

Ask A Question