TechMafioso
TechMafioso

Reputation: 135

Yii2: GridView Speed Optimization

I'm using Yii2 GridView to display data from ActiveDataProvider, the speed of it is working nicely when its pagination-enabled. But when displaying all the rows, everything lags.

I'm using a normal Controller->View flow.

Added Database Caching also Normal Controller

Upvotes: 1

Views: 1393

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133380

Without pagination al the rows are fetched by the ActiveDataProvider and rendered dy gridview ..

Regardless of performance. This is unhelpful in terms of an acceptable user experience.

If your need is to have client side of the totality of data, it is advisable to avoid the use of the ActiveDataProvider and the gridview, and alternatively use a sql command creat with with createCommand(....); and sql and restrain the result as a JSON structure to process client / side

Upvotes: 1

Related Questions