Wordpress LScache Plugin: How to use shortcode to specify shortcode pairs
Your document only mention use esi like [esi cache= private vc_row] But I have a shortcode pair[vc_row] contents [/vc_row] only modify [vc_row] to [esi cache= private vc_row] will leave [/vc_row] unpaired and does not work. To be more specificed, I am using a Plug-in named Custom Content by Country that hides some elements on my home page accordign to i p& country. I diasble youtube video block for Chinese visitors as they are banned for Youtube. CBC is the short code of Custom Content by Country. vc_row are code of visual composer. [vc_row][vc_column offset= vc_hidden-xs ][CBC show= n country= cn ][rev_slider slidertitle= Slider 1 alias= slider-1 ][/CBC][/vc_column][/vc_row] This topic was modified 10 months, 4 weeks ago by wtvxy. Hi, unfortunately it doesnt support nicely for multi-block ESI shortcode Best regards, Is anyother way to convert my multi-block blocks to ESI other than shortcode? Specificlly, in elementor. Im afraid no OK. Can I exclude cache for certain plugin? I am using a country & ip based plugin to redirect my homepage for some countries visitors. I dont want to ip be uesd by next visitor. They may come from differnt country. Hi, no , its a page cache , you can not just make certain plugin or part of page that dont be cached , well , it can be done by ESI , but not in this multi-block shortcode case if your ultimate goal is to have cache based on country / IP , that might be doable what is your server env ? shared hosting ? your own server ? any CDN involved ? like QUIC cloud CDN or CloudFlare ? Best regards, I need to clearify that I mentioned two plugins for two solutions. Since multi-block shortcode is infeasible, I would rather try another solution with ip-based redirect plugin: make a new page for Chinese customers and use ip to redirect from my home page to new page. I use shared host of namecheap and Quic.cloud CDN. Hi, for any kind of IP-based redirection , you will need to involve the rewrite rule the plugin wont work by default because when page is cached, there is no PHP launched , and since no PHP launched , plugin will not run please try add this at top of your .htaccess RewriteRule . - [E=Cache-Control:vary=% HTTP:x-qc-country ] then it will serve different cache based on users country Ok. I also find another post related to this:https://wordpress.org/support/topic/some-questions-to-vary-cache-by-country/ It seems that I need to add these codes to .htaccess: RewriteEngine on RewriteRule . ? [E=Cache-Control:vary=other] #set default vary to other RewriteCond % ENV:GEOIP_COUNTRY_CODE_BY_NAME CN RewriteRule . ? [E=Cache-Control:vary=CN] Will quic.cloud sends country in header as cloudflare? RewriteCond % ENV:GEOIP_COUNTRY_CODE_BY_NAME CN to RewriteCond % HTTP:x-qc-country CN 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] Get it, thank you! I will test it next week. I set up Quic.cloud CDN and add above codes to .htaccess today. I meet a unpredictable situation. When I visit the website by domain.com, it correctly detect I am from CN and redirect. (domain.com is redirected to http://www.domain.com according to my wordpress setting) When I visit the website by http://www.domain.com, it detect I am from HK and do not redirect. You can see the debug log below. 43.231.0.46 is the ip of Quic.cloud CDN HK server and 101.37.118.27 is my true CN ip. I only want to set up CN but not HK direction. Could you help me figure out what happen? time : 2022-01-04 03:15:19 , client_ip : 101.37.118.27 , location : CN , lookup_by : ?? , cache :true, uri : https: / /theryang.com / , message : CN is listed in [CN] , action : MATCHED time : 2022-01-04 03:15:19 , client_ip : 101.37.118.27 , location : CN , lookup_by : ?? , cache :true, uri : https: / /theryang.com / , message : Destination: /collection , action : REDIRECTED time : 2022-01-04 03:15:19 , client_ip : 101.37.118.27 , location : CN , lookup_by : ?? , cache :true, uri : https: / /theryang.com / , message : CN is listed in [CN] , action : MATCHED time : 2022-01-04 03:15:19 , client_ip : 101.37.118.27 , location : CN , lookup_by : ?? , cache :true, uri : https: / /theryang.com / , message : Destination: /collection , action : REDIRECTED time : 2022-01-04 03:15:19 , client_ip : 101.37.118.27 , location : CN , lookup_by : ?? , cache :true, uri : https: / /theryang.com /collection , message : CN is listed in [CN] , action : MATCHED time : 2022-01-04 03:15:19 , client_ip : 101.37.118.27 , location : CN , lookup_by : ?? , cache :true, uri : https: / /theryang.com /collection , message : Page is not matched. , action : ABORTED time : 2022-01-04 03:15:21 , client_ip : 43.231.0.46 , location : HK , lookup_by : ?? , cache :true, uri : https: / /www.theryang.com /about / , message : HK is NOT listed in [CN] , action : ABORTED time : 2022-01-04 03:15:22 , client_ip : 43.231.0.46 , location : HK , lookup_by : ?? , cache :true, uri : https: / /www.theryang.com /collection / , message : HK is NOT listed in [CN] , action : ABORTED time : 2022-01-04 03:15:27 , client_ip : 43.231.0.46 , location : HK , lookup_by : ?? , cache :true, uri : https: / /www.theryang.com / , message : HK is NOT listed in [CN] , action : ABORTED time : 2022-01-04 03:15:31 , client_ip : 43.231.0.46 , location : HK , lookup_by : ?? , cache :true, uri : https: / /www.theryang.com / , message : HK is NOT listed in [CN] , action : ABORTED Hi, whats your server set up ? create a php file with code