# Control Data Size

Visualforce pages have a 15-MB standard response limit, and smaller pages load faster than larger pages. To minimize load times, limit the amount of data that each page displays.

## Filter Query Results

- Use filters to limit the data that Salesforce Object Query Language (SOQL) calls in and that Apex controllers return. For example, use `AND` statements in `WHERE` clauses. You can also remove null query results.
- When creating Apex controllers, use the `with sharing` keyword to retrieve only records that the user can access.
- Filter in SOQL first, then in Apex, and finally in Visualforce.

## Use Pagination

- A page with unbounded data can cause longer load times, hit governor limits, and become unusable as the dataset grows. To prevent a list view from displaying unbounded data, implement pagination with a list controller. By default, a list controller returns 20 records per page, but you can configure list views to display up to 100 records at a time. To control the number of records each page displays, use a controller extension to set the `pageSize`.
- Use the SOQL `OFFSET` clause to write logic that paginates to a specific subset of results within SOQL.

**See Also**

- [*Apex Developer Guide*: Working with Very Large SOQL Queries](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_VLSQ.htm)
- [*Apex Developer Guide*: Using the with sharing, without sharing, and inherited sharing Keywords](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm)
- [*SOQL and SOSL Reference*: OFFSET](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_offset.htm)
- [Pagination with a List Controller](/docs/platform/salesforce-pages-developers-guide/guide/pages-controller-sosc-pagination.md)
- [Working with Large Sets of Data](/docs/platform/salesforce-pages-developers-guide/guide/pages-controller-readonly-context.md)
