Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
litespeed_wiki:cache:lscache:geoip-support [2019/01/08 18:57] Jackson Zhang |
litespeed_wiki:cache:lscache:geoip-support [2022/04/20 19:07] Lisa Clarke |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== How to enable geolocation for LSCache ===== | + | ~~REDIRECT>https://docs.litespeedtech.com/lsws/cp/cpanel/geoip/#use-geoip-for-cache-varies~~ |
- | + | ||
- | LSCache supports GEOIP. You should follow [[litespeed_wiki:cache:common:geoip-support|this wiki]] to enable GeoIP module on LSWS and test it to ensure it is working. Then you can use different rewrite rules to meet your cache need. | + | |
- | + | ||
- | For example, to make cache vary by GEO_COUNTRY, you can add the following rewrite rules to your “.htaccess” file: | + | |
- | + | ||
- | <IfModule LiteSpeed> | + | |
- | RewriteEngine on | + | |
- | RewriteRule .* - [E=Cache-Control:vary=%{ENV:GEO_COUNTRY}] | + | |
- | </IfModule> | + | |
- | + | ||
- | You can add rewrite condition for more specific rules, such as UK, EU and US + the rest of the world show different contents, or show different currencies. | + |