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:
- The web-component is not automatically updated (… it’s in the browser’s cache?)
- 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 once of all local storage in the visitor’s web browser for my WordPress plugin?