Setting Read-Only Mode for an Entire Page
To enable read-only mode for an entire page, set the readOnly attribute on the <apex:page> component to true.
For example, here’s a simple page that is processed in enable read-only mode:
The controller for this page is also simple, but illustrates how you can calculate summary statistics for display on a page:
Normally, queries for a single Visualforce page request may not retrieve more than 50,000 rows. In enable read-only mode, this limit is relaxed to allow querying up to 1,000,000 rows.
In addition to querying many more rows, the readOnly attribute also increases the maximum number of items in a collection that can be iterated over using components such as <apex:dataTable>, <apex:dataList>, and <apex:repeat>. This limit increased from 1,000 items to 10,000. Here’s a simple controller and page demonstration:
While Visualforce pages that use enable read-only mode for the entire page can’t use data manipulation language (DML) operations, they can call getter, setter, and action methods that affect form and other user interface elements on the page, make additional read-only queries, and so on.