Effects caching

How can I cache effects?
How can I make switchEffect return byteArray: Uint8Array?