• 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

Viewing 1 replies (of 1 total)
  • Plugin Author wrigs1

    (@wrigs1)

    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

Viewing 1 replies (of 1 total)
  • The topic ‘State/Province based cache’ is closed to new replies.