I'm using CustomerData library to display private content (Magento docs).
I see that in
etc/frontend/sections.xml I can configure which requests would result in requesting the data from the server and storing in browser's local storage.
Is there a way to specifically ask to invalidate the data (the particular section)? For example, I want to request it if a data property is absent or if a data property had been received more than 1 hour ago.
Do I make a dedicated dummy action that does nothing just so I could add it to
etc/frontend/sections.xml and a request by AJAX when I need to invalidate the section cache, or is there some better way?
If this is the solution, then why should I bother with the customer data at all? I could just make that AJAX call return the data I need and store it the local storage myself.