Problem: Change does not reflect immediately in chatbot iframe on publishing it in amazon lex console against an alias (I have checked that chatbot alias is pointing the correct version and using the same alias only it is deployed in lex-web-ui).
Description:
A lex chatbot is deployed using lex-web-ui and embedded as an iframe on a website.
Steps:
- I opened the website on a google chrome/cognito or microsoft edge/edge private window and tested a bot and Its working fine
- One of the intent of my bot have 5 slots asking 5 questions.
- Now there is a task according to which one specific question needs to be removed from that intent.
- So I deleted the slot pointing to that particular question, saved the intent, build the bot and published it against the same alias. Also checked in the setting, the alias was pointing to the latest version.
EXPECTATIONS- On refreshing the application in google chrome/incognito or edge/private window the published change should immediately reflect.
OBSERVATIONS:-
- After refreshing the application and opening the chatbot, we could not find any change that was published in lex console, (it still ask 5 questions whereas it was suppose to ask only 4). In order to reflect those change in iframe i need to clear cache
- But this is not a case when we use chatbot as a standalone project. As soon the change is published, after refreshing the standalone chatbot those changes are visible, means instead of 5 questions it asks 4 (no need to clear caches)
The cache invalidation is to ensure that any changes to the presentation layer (web-ui) are correctly reflected in the client's browser. Lex itself is not cached by CloudFront so the invalidation has no impact on Lex (so long as you're pointing to the same bot and alias combination.
You can safely publish your Lex changes without needing to run cache invalidations.