Discrepancy between template size and card.usage.get reported size

I’m using a compact template to keep the cellular sending size of each note to a minimum, with the reported size being 17 bytes. However, when checking with card.usage.get, the note size is reported as 328 bytes. My template contains two small strings (18 characters total) which may not be being calculated by the template, but cannot be that large.

Is this change in size due to metadata? If so, is there a way I can remove it, or otherwise further reduce the sending amount?

Hi @mallonwm and welcome to the Blues community!

To be clear, the card.usage.get API doesn’t return just the size of the Note as sent over the wire, but rather all of the network traffic for a defined period by using the mode argument:

{
  "req": "card.usage.get",
  "mode": "1hour"
}

So what you are likely seeing is not only the Note itself, but potentially the overhead associated with establishing a cellular connection and the overhead of a one-time sync of the template information with Notehub. Also note that usage data is updated by the Notecard at the end of each session.

Another good way to check on data usage is to look at the Sessions tab in Notehub.

If you haven’t already, I’d recommend taking a look at our Low Bandwidth Design guide too!

Thanks,
Rob