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
PrakashbPrakashb 

Data Cache in Salesforce

Hi,

 

We have a requirement were in we need to fetch datas which are stored in Salesforce objects and we need that to be cached on the VF page instead of the controller.

 

We have actions to be executed based on the data  which we are storing, so we do not want to hit the controller each and every time for verifying the data.

 

Is there an option in Salesforce where in we can put the data in the memory of the page and use those data using Javascript or some other option.

 

Any help would be greatly appreciated.

 

Thanks.

 

Prakash

bob_buzzardbob_buzzard

This sounds like a use case for Javascript remoting - that will return the data in a javascript friendly format which makes it easy to manipulate inside the page.

 

I used this blog post as the starting point when I first used this:

 

http://blogs.developerforce.com/developer-relations/2011/02/quick-look-into-javascript-remoting.html

Navin SoniNavin Soni
Hi Prakashb,

There are two types of cache:

Session cache — Stores data for individual user sessions. For example, in an app that finds customers within specified territories, the calculations that run while users browse different locations on a map are reused.
A session cache lives alongside a user session. The maximum life of a session is eight hours. A session cache expires when its specified time-to-live (ttlsecs value) is reached or when the session expires after eight hours, whichever comes first.

Org cache — Stores data that any user in an org reuses. For example, the contents of navigation bars that dynamically display menu items based on user profile are reused.
Unlike a session cache, an org cache is accessible across sessions, requests, and org users and profiles. An org cache expires when its specified time-to-live (ttlsecs value) is reached.

Thank You,
Navin Soni