Title: Geotargeting + cache = bug
Last modified: May 24, 2018

---

# Geotargeting + cache = bug

 *  Resolved [aelthen](https://wordpress.org/support/users/aelthen/)
 * (@aelthen)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/geotargeting-cache-bug/)
 * Hi,
 * The geotargeting function of the plugin doesn’t work with a cache plugin…
 * It took me some time to see the bug, identify the problem and be able to reproduce
   it almost 100% of the time, but here it is:
 * 1) Clear the cache
    2) test the page with gtmetrix –> since the test server is
   in Canada, it will simulate a visiteur from canada 3) access the page in private
   navigation (not logged as admin, since cache is often disabled for admins) –>
   the price will be in CDN, the link will be amazon.ca EVEN if you’re not in Canada.
   I live in France, and I see the canadian version of the links…
 * If I disable the cache –> I see the french version of the links.
 * So it means that if someone from Canada visit my page first, everyone who will
   visit the page after that will see the canadian links. That is obviously a big
   problem.
 * I tested with WPFC (wordpress fastest cache) and wprockets, and I have the same
   problem with both plugins.
 * Can I exclude something from the cache to avoid this problem ? A specific javascript
   or something ?
    -  This topic was modified 7 years, 12 months ago by [aelthen](https://wordpress.org/support/users/aelthen/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Amazon Associates Link Builder](https://wordpress.org/support/users/amazonlinkbuilder/)
 * (@amazonlinkbuilder)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/geotargeting-cache-bug/#post-10364318)
 * Dear [@aelthen](https://wordpress.org/support/users/aelthen/),
 * We don’t use javascript for this country decision for showing ads so whitelisting
   that won’t help.
    Just see if in your cache-plugin:
    - You can whitelist the shortcode
    - Enable something like country-specific cache
 * Please let us know if any of above is possible.
 * But, if any of above doesn’t work you will have to disable cache for posts using
   the AmazonAssociatesLinkBuilder plugin.
 *  Thread Starter [aelthen](https://wordpress.org/support/users/aelthen/)
 * (@aelthen)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/geotargeting-cache-bug/#post-10365477)
 * I use WP fastest cache and I can only excluse pages, user-agents, cookies, JS
   or CSS.
 *  Plugin Author [Amazon Associates Link Builder](https://wordpress.org/support/users/amazonlinkbuilder/)
 * (@amazonlinkbuilder)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/geotargeting-cache-bug/#post-10383968)
 * Dear [@aelthen](https://wordpress.org/support/users/aelthen/),
 * In that case, you have to do any one of following:
    - Exclude all posts/pages using geo-
       targeted links from caching.
    - Switch to another caching plugin which supports shortcode-exclusion from caching
      or prvides a country-specific caching feature.
 *  [Daniel J. Lewis](https://wordpress.org/support/users/djosephdesign/)
 * (@djosephdesign)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/geotargeting-cache-bug/#post-10405169)
 * Nuts. This means we can’t combine this plugin with any easy-to-use, efficient,
   whole-page caching plugins like WP Rocket or WP Super Cache.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Geotargeting + cache = bug’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amazon-associates-link-builder_fec375.
   svg)
 * [Amazon Associates Link Builder](https://wordpress.org/plugins/amazon-associates-link-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-associates-link-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-associates-link-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-associates-link-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-associates-link-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-associates-link-builder/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Daniel J. Lewis](https://wordpress.org/support/users/djosephdesign/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/geotargeting-cache-bug/#post-10405169)
 * Status: resolved