Can someone accurately describe the trigger criteria for Gmail Add-on scripts? Apparently, the trigger is not invoked each time the user navigates between Gmail conversation
you can use ActionResponseBuilder.setStateChanged(), to clear the cache
link: https://developers.google.com/gmail/add-ons/how-tos/interactions
Currently, Google Apps Script doesn't have triggers for Gmail events so the trigger will not invoke every time, the user navigates to a different Gmail conversation. Whenever a new message open it will invoke trigger, contextual trigger. You can also tryout time-driven trigger which invokes after each time interval. To use time-driven trigger open your project on https://script.google.com/. In Apps Script Editor, navigate to Edit -> All your triggers. If there is no trigger then setUp one and Save. See this example Create Time-driven trigger in Gmail-add on
Refer this link for more information How do I detect when I view an email in gmail with google-apps-script script? I think this might be helpful.