WPIntell

Source evidence

State/Province based cache

Country Caching For WP Super Cache · support · 2018-11-26T13:01:00+00:00

complaintsentiment
mediumseverity
0.88relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 31 rows with source links

12.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

27 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Carlos Faria unresolved
Hi, first of all thank you for this great plugin! It will solve most of my problems. But I have one more and I don’t know if this plugin would solve it the way it is coded right now… In Spain there are some regions that are VAT excluded (Canary Islands for instance), so ¿is it possible to have a cache based on states/provinces? As I can see in the docs you can put country codes to have different caches, but I need also to have different caches between regions in the same country. I need ES caching (21% VAT) and then Canary Islands caching (0% VAT). The problem I have is that the pages cached to users on the Canary Islands are shown to users on other regions of Spain and the other way too, users on the Canary Islands see prices with VAT as the pages are cache generated when a user in Spain sees the page. If you have the code on github I would try to figure it out and do a PR. Summing up, what I need is to create unique cache files to country:region, something like ES:TF, where ES stands for Spain, and TF stands for Tenerife. I know it’s not easy to figure it out but lets give it a try ;D Hi carlosfaria Thanks for the praise of this plugin. Sorry for delay in response. Its not something I’d do myself, and I didn’t have a GitHub a/c but I set one up just for you! https://github.com/Andy-Wrigley/cc4wpsc Issues: 1. identifying state. From recollection state is not provided by Maxmind country.mmdb? or Cloudflare. If user opts for state level caching then separate lookup will have to be done using Maxminds city(?) database. 2. performance: Many more “pages” will need to be separately cached. City database is HUGE and will have some impact on look-up speed. 3. User settings interface: will need modifying to additionally allow option of additionally caching by state for specified or all countries. 4. It may have a major impact on caching logic. It might be possible to minimise impact by using a cookie and WPSC hook e.g. do_action( ‘wpsc_add_cookie’, ‘cc4wpsc_state’ ); see https://odd.blog/category/wordpress/ I’m very busy developing Country Caching for WP Rocket at moment so I can spend little time on this and responses may be slow. N.B. the Rocket version can use Amazon Geoip or HTTP Header/Server Var Geoip and at some point I’ll retrofit this into CC for WPSC. best Andy

Comments

1 shown
wrigs1 2018-12-03T12:14:00+00:00

Hi carlosfaria Thanks for the praise of this plugin. Sorry for delay in response. Its not something I’d do myself, and I didn’t have a GitHub a/c but I set one up just for you! https://github.com/Andy-Wrigley/cc4wpsc Issues: 1. identifying state. From recollection state is not provided by Maxmind country.mmdb? or Cloudflare. If user opts for state level caching then separate lookup will have to be done using Maxminds city(?) database. 2. performance: Many more “pages” will need to be separately cached. City database is HUGE and will have some impact on look-up speed. 3. User settings interface: will need modifying to additionally allow option of additionally caching by state for specified or all countries. 4. It may have a major impact on caching logic. It might be possible to minimise impact by using a cookie and WPSC hook e.g. do_action( ‘wpsc_add_cookie’, ‘cc4wpsc_state’ ); see https://odd.blog/category/wordpress/ I’m very busy developing Country Caching for WP Rocket at moment so I can spend little time on this and responses may be slow. N.B. the Rocket version can use Amazon Geoip or HTTP Header/Server Var Geoip and at some point I’ll retrofit this into CC for WPSC. best Andy