Reducing payload size

I have been taking advantage of the modelUpdateMode “merge” to reduce the payload sent from FMS.

But the docs for that here also state:

In addition to reducing the data model, other payload keys can optionally be removed. The form pages and options keys can also be removed. These key are normally populated with form schema data and generally do not get mutated by the hook scripts. If the keys are empty the BetterForms client will continue to use the existing values significantly reducing the hook payload size and increasing performance.

But I found if I clear $$BF_Form and $$BF_Pages or set them to “{}”, the page loads empty, and if I remove the data.form and data.pages keys entirely from the payload at the end of the Receiver and Dispatch script, my page just shows a loading spinner forever…

If you have onFormRequest hook enabled then they must be included. The removing of them would apply in hooks where someone is dynamically generating schema from FMS and only on some hooks would want to include.

Generally you dont need to touch the mergeMode as its automatically set as soon as you add the modelFilterKeys

HTH