Clear the Response of a Message

When you change the scope of a message its response then it needs to be cleared via your script in order to maximize performance. Once the message response that was scoped 'local' or 'public' has been used, clear the response to ensure that large responses do not stay in memory (if they are no longer needed).

Use the clearResponse method to do so.

For example, the line ( msg.clearResponse(); ) as shown on the right.

var msg = $context.currentItem.previousItem; msg.clearResponse();