wtvxy
Forum Replies Created
-
Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesI do not what happen.
It redirect every country to /collection now, even I purge litespeed and cdn cache,Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesmaybe this enough?
RewriteCond %{HTTP:x-qc-country} CN RewriteRule ^/?$ https://www.theryang.com/collection/ [R=301,L]
Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesWell. It does not work now…..
I think I still need to set up.
How should I write this logicalif 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.
Forum: Plugins
In reply to: [YITH WooCommerce Wishlist] Share button icon do not showThank you. They work.
I think this may because this plugin use the css style from my theme and some elements become wired.
For example, the layout of wishlish table looks not aligned correctly in mobile vesrion . Some of the font size is too small and some are too large. Is there a more convenient approach I can customize them instead of modify css everytime?Plus, if I use YITH account page plugin, I can see the wishlist in account page menu, but ‘open the wishlist’ button will link to this menu instead of a single wishlist page. If I do not use YITH account page plugin, I cannot see the wishlist tab in account page menu. Are they mutually exclusive?
Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesOK. I will continue testing this in the future and discuss with you if it failed someday.
Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesYes. I understand what you mean. But the redirection still works for my website without vary cache. That’s 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.- This reply was modified 3 years, 2 months ago by wtvxy.
Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesI 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.Sorry I found nobody maintain this plugin anymore. What a pity.
I think it has the potential to be a great optimize tool.Forum: Plugins
In reply to: [IP2Location Redirection] Redirection does not work for www.*.comOK. I resolve the problem and want to share at here as a archive for others.
https://www.domain.com will go to my CDN.
As I debug, I find the Quic.Cloud CDN only send node ip as REMOTE-ADDRESS to my server.I vardump($SERVER) and found there is a field ‘HTTP_X_CLIENT_IP’ can provide real clinet ip.
Then I add these codes to the top of wp-config.php:
<?php
// Use X-Forwarded-For HTTP Header to Get Visitor’s Real IP Addressif ( isset( $_SERVER[‘HTTP_X_CLIENT_IP’] ) ) {
$http_x_headers = explode( ‘,’, $_SERVER[‘HTTP_X_CLIENT_IP’] );$_SERVER[‘REMOTE_ADDR’] = $http_x_headers[0];
$_SERVER[‘HTTP_X_FORWARDED_FOR’] = $http_x_headers[0];
}`Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesOK. Please treat the first question as a request.
For second one, I found it’s 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?
Forum: Plugins
In reply to: [LiteSpeed Cache] Disable WP Native Lazy LoadYes. This work. Which lazy-load is more efficient? WP or Litespeed?
Forum: Plugins
In reply to: [LiteSpeed Cache] How to avoid duplicating UCSS for each product pagesOne 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?
Forum: Plugins
In reply to: [LiteSpeed Cache] How to use shortcode to specify shortcode pairsOK. I resolve the problem and want to share at here as a archive for others.
I vardump($SERVER) and found there is a field ‘HTTP_X_CLIENT_IP’ can provide clinet ip.Then I add these codes to the top of wp-config.php:
<?php // Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address if ( isset( $_SERVER['HTTP_X_CLIENT_IP'] ) ) { $http_x_headers = explode( ',', $_SERVER['HTTP_X_CLIENT_IP'] ); $_SERVER['REMOTE_ADDR'] = $http_x_headers[0]; $_SERVER['HTTP_X_FORWARDED_FOR'] = $http_x_headers[0]; }
Forum: Fixing WordPress
In reply to: How to remove elements from external iframe?https://www.ads-software.com/plugins/advanced-iframe/
This plugin claims they can modify the elements in iframe.But I have installed too many plugins. I am looking for a light solution.
Forum: Plugins
In reply to: [LiteSpeed Cache] Transparent Responsive PlaceholderThank you @essaund, this works for me. I also find LQIP is too ugly and in my website it only shows 0.5ms which seems to be uneccessary. Transparent Responsive Placeholder is the best solution so far.