Prevent Form Submission Of Unchanged Model Instances

I’m using the Collecting Tabular Input feature in my view described here and in general it works well. There are 20 model instances loaded in a form and editable inside a table, this improves the general overview a lot - thanks for this great feature!!!

And now my problem - a huge load on the sever:

In case the Ajax validation is enabled, each change in a single form-fields causes to send the complete form with all 20 model instances and therefore triggers the rule check for all the instances.

The same for the save / submit of the form. In most cases the user only changes 1 or 2 instances, but there are all 20 submitted to the server and therefore saved within the AR-model. This also includes some data synchronization outside the Yii database, so allover too much load.

OK, I have a very small server (embedded 400MHz single core CPU), but in general it is capable handling Yii load very well.

What I’ve considered or done already:

  • Using APC improving the allover performance a lot.

  • Testing reduced page size to 10 or even 5 instances, but this also reduces the general view too much

  • Disabling Ajax-validation would be a big loss in comfort

  • Splitting the big form into a single form per instance - but this would lead to 20 submit buttons

  • Using a bigger server is not an option :frowning:

My only left over idea is to make a kind of "diff" within the controller, to compare all attributes of all received form instances with the original ones loaded from database. Than pass only the changed ones to the Ajax validation or save. But this somehow looks stupid for me, because all the load already passed the network and it is a lot to implement.

So, is there a possibility to limit the Ajax validation and save-button to POST only the updated instances?

Thanks Achim