Skip to main content

How do I clear the location cache when testing polaris.js?

When testing polaris.js, you may want to VPN to different locations to observe how our Consent Management Platform (CMP) performs on your website. By default, polaris.js remembers a visitor's location for up to 12 hours when using the same browser. To see these location changes take effect, you'll need to clear the location cache that polaris.js uses. This is stored in the browser's "local storage" rather than a cookie.

Basic Approach (Clear All Site Data)

The fastest way to clear the location cache is to remove all site data (cookies & local storage) using the built-in feature of your browser. Each browser has a slightly different way of achieving this, detailed below.

Chrome

In Chrome and most Chrome-based browsers (Edge, Brave, etc.), follow this path to clear all cookies and local storage when visiting your website:

  • Click the options icon to the left of the URL
  • Click Cookies and site data
  • Click Manage on-device site data
  • Click the trash icon next to the website URL
  • Click Done

Firefox

In Firefox, follow this path:

  • Click the padlock icon to the left of the URL
  • Click Clear cookies and site data
  • Click Remove

Safari

  • Press Cmd (⌘)+, to open the Preferences Dialog
  • Click on the Privacy tab
  • Search for your website, select it, and click Remove

Technical Approach (Clear Only Polaris Cache)

If you rely on cookies or local storage during your testing, and don't want to clear all the local data for your website as shown above, you can clear the following local storage entries:

  • TV_IP_LOCATION_FETCH_EXPIRATION
  • TV_IP_LOCATION_FETCH_PAYLOAD

Open the developer tools for your browser, find the Storage tab, and delete them from Local Storage for your website. This will cause polaris.js to redetermine the user's location.