Optimization Tips & Tricks
Collection of tips and tricks to optmize various aspects of the plugin.
Wrap multiple calls with PacketBufferHelper
¶
Using PacketBufferHelper
we can buffer up MQTT packets and send them in fewer network packets:
Use Topic Aliases¶
To spare sending the topic name every time with an application message a topic alias can be added. It's recommended to use it for long or frequantly used topic names.
AddTopicAlias
doesn't generate a packet, the mapping is sent with the next application message that going to be sent with that topic name.
Compress text payloads¶
Large text payloads should be sent compressed when possible. Using the WithContentType
the publisher can indicate that the payload is compressed and subscribers can act accordingly.
All receiving subscribers must be prepared to be able to handle the compressed content.