function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hoomelhoomel 

Reduce reponse size

Hello, 

 

i am currently at the last steps to finish programming a calendar to display rental periods of products.

 

Since the final productive environment could have quite big amounts of data, i started testing by entering some dummy data.

Just before the calendar is finally rendered, i get the error message 'Response size exceeded 15MB organization limit' .

To work on this issue I now need to know what data exactly contribute to this size and if there are general possibilities to reduce this size.

Since the amount seems pretty huge to me, is this 'response size' the sum of all data from Apex and Visualforce or only Apex calls or Visualforce data?

 

If you need any other information, i will be glad to provide it and I hope someone could give me a hint.

 

Regards,

hoomel

Best Answer chosen by Admin (Salesforce Developers) 
hoomelhoomel

The problem is not exactly the size of the page itself, but a nested if-clause which has to compare way too much data and therefore causing the page to time out when a certain amount of data is exceeded.

We are currently working on reducing the data that need comparing.

 

Thanks anyway for the help.

 

 

Edit: We were able to reduce the amount of data by correcting some malpractices regarding SOQL and some other minor things.

We also used a case-statement instead of an if-clause to reduce the amount of data that are being compared.

All Answers

GobbledigookGobbledigook

It sounds like to me the calender you're rendering is larger than 15MBs by itself, which is your limit. 

 

For that matter, even getting the Calender under 15 MB will still take up most of your data. 

 

Is there any way to limit what goes on your Calender for rendering?  How much Code/Data do you have in your Org anyway?

hoomelhoomel

The problem is not exactly the size of the page itself, but a nested if-clause which has to compare way too much data and therefore causing the page to time out when a certain amount of data is exceeded.

We are currently working on reducing the data that need comparing.

 

Thanks anyway for the help.

 

 

Edit: We were able to reduce the amount of data by correcting some malpractices regarding SOQL and some other minor things.

We also used a case-statement instead of an if-clause to reduce the amount of data that are being compared.

This was selected as the best answer
TehNrdTehNrd

When you say a nested if else function do you mean in the visualforce itself? Like this: {!IF(something,true,IF(something,true,IF(something,true,false)))}

 

I to am trying to isolate the issue that is causing this error.

hoomelhoomel

Yes, we had these nested IF-clauses inside the Visualforce page itself.

I can't remember to the point how we solved it, but we manged to reduce the amount of data the page got from the controller.

 

I think we were able to break down a couple of IF-clauses to a CASE-formula. In this case, not all the data is compared and when the value you are comparing to is met, they exit and do not compare anything else.

 

We also changed the structure of some apex:repeats for our matter.

This page also helped to some extent with finding the "bad stuff" on the page, which was causing the most against the response size:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_best_practices_performance.htm

 

I hope this helps in a way.

 

Regards,

hoomel