Newer Version Available
JavaScript Remoting Limits and Considerations
JavaScript remoting isn’t a way to avoid Salesforce service limits. JavaScript remoting calls aren’t subject to API limits, but Visualforce pages that use JavaScript remoting are subject to all standard Visualforce limits.
By default, the response of the remote call must return within 30 seconds, after which the call will time out. If your request needs longer to complete, configure a longer timeout, up to 120 seconds.
The request, including headers, has a maximum size of 4 MB.
- Reduce the size of the response for each request. Only return data that’s required.
- Break up large data retrieval into requests that return smaller chunks.
- Make batched requests more frequently, reducing the size of each individual batch.
- Use non-batched requests. Set { buffer: false } in your remoting request configuration block.
Salesforce logs error messages from some JavaScript remoting calls. You can prevent personal information from being logged by not including customer data in error messages. Instead, catch exceptions and log the full message. Then return a user-friendly message to your Visualforce page.