+ Start a Discussion

Data Cache in Salesforce



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.






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:



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