sneeuwitje
sneeuwitje

Reputation: 131

Enforce clear cache and local storage ONCE for WordPress plugin with web components

I developed a WordPress plugin that renders React-driven web components in WordPress Shortcodes. These web components heavily use local storage to 'remember' the last state of the Shortcode as the user visited it. I have made some changes in my plugin that will break when users will access the WordPress pages with their current local storage.

On my test-environment, I encounter 2 issues with my Chrome browser with default settings:

  1. The web-components are not automatically updated (... they are in the browser's cache?)
  2. The local storage contains JSON data that is incompatible with the updated JavaScript of my web-components

)1 — How do I enforce a visitor's browser to clear cache once, preferably within the PHP code of my WordPress plugin, for the website that uses my plugin?

)2 — How do I enforce delete local storage once in the visitor's web browser for my WordPress plugins' web components?

Upvotes: 0

Views: 60

Answers (0)

Related Questions