Skip to main content

Questions tagged [platform-cache]

The Force.com Platform Cache layer provides faster performance and better reliability when caching Salesforce session and org data. Specify what to cache and for how long without using custom objects and settings or overloading a Visualforce view state. Platform Cache improves performance by distributing cache space so that some applications or operations don’t steal capacity from others.

Filter by
Sorted by
Tagged with
0 votes
0 answers
44 views

How to install Managed Package with Provider free Cache partitions in Professional Edition Org?

Issue : When trying to install a managed package in professional edition org, its failing with below error. Error message: "This package can’t be installed. There are problems that prevent this ...
Vasudev Pai's user avatar
0 votes
1 answer
123 views

Behaviour of Org Platform Cache - reading/writing during concurrent transactions

In attempting to use the Org Platform Cache as a 'transaction-spanning' variable, we tested the following scenario involving concurrent transactions: Transaction 1: //assume the Cache.Org.someBool ...
edralph's user avatar
  • 562
1 vote
0 answers
100 views

Platform Cache : Cache via Cachebuilder getting evicted in 5 minutes

I am using CacheBuilder to store data retrieved from GET /ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}, so as to reduce the number of callouts made to org. After reading the ...
Nagendra Singh's user avatar
1 vote
0 answers
89 views

Is it possible to fetch/retrieve specific or all user's session cache details?

We are setting some information using the platform cache (session cache) and we are facing some issues/inconsistencies in the data. So, it is possible to retrieve stored user session cache details ...
Rajendra Singh Nagar's user avatar
2 votes
0 answers
398 views

Including cache partition in managed package

I'm trying to include a cache partition in a managed package with "Provider Free" space allocated. In my packaging org I created a cache partition with a "Provider Free" value of &...
James's user avatar
  • 337
0 votes
2 answers
556 views

Platform Cache Breaks sfdx retrieve?

I have added a platform cache partition to my managed package source code: I have just added Platform Cache to my package.xml file: <types> <members>*</members> <name>...
Dave C's user avatar
  • 467
1 vote
0 answers
31 views

Trial cache partition not released after having uninstalled a package

Each time I uninstall a package from my scratch org, the trial cache capacity is not released. So the only possibility I have is to create a new scratch org, request a new trial cache and then install ...
learner's user avatar
  • 75
1 vote
1 answer
651 views

Can we set the Platform Cache using API call

I have a requirement where I need to maintain/use few values through out the session and I am thinking to use Platform Cache. Since, we are getting these values from a 3rd party I am wondering if we ...
Noob_NoVoice's user avatar
  • 2,709
1 vote
1 answer
479 views

Is it possible to pre-warm a session or org cache partition when using the CacheBuilder interface?

I'm working on reducing data storage space and increasing the amount of automation for an integration with an external system. The relevant part of that integration for this question is a sync of ...
Derek F's user avatar
  • 62.8k
0 votes
1 answer
407 views

How to pass cookie/storage details from other website to the salesforce [closed]

I am trying to pass some details from a non-salesforce website to salesforce website while creating the case. Use Case : I am in a product website and if I have any question then I will click the help ...
Noob_NoVoice's user avatar
  • 2,709
0 votes
0 answers
3k views

Calling LWC from Aura component, but LWC doesn't render when using standard button to call aura for the 2nd time

I'm fairly new to Aura and LWC altogether. I'm overriding a standard new button with an Aura Component and calling an LWC component from there. LWC component calls another LWC component from it. I'm ...
Abhinav Gupta's user avatar
0 votes
0 answers
26 views

Provider Free Capacity [duplicate]

I've updated the cachePartition metadata of a 2GP package, which has previously passed security review. <platformCachePartitionTypes> ... <allocatedPartnerCapacity>2</...
Oleksii Fisher's user avatar
0 votes
0 answers
233 views

How to access Platform Cache using REST API

I have a requirement to retrieve available resource and consumed resources for Platform Cache outside my salesforce org. I was wondering if we can use REST API to retrieve this result ? Given a try by ...
Chirag Verma's user avatar
2 votes
0 answers
221 views

Is it possible to make cache session expiry time based on put instead of get

In Apex, when we put information into cache.session, there is a method to set the expiry time based on seconds. However, that expiry time seems to be re-calculated every time we put or get into/from ...
Lance Shi's user avatar
  • 13k
1 vote
1 answer
1k views

Platform Cache - error-like debug log message

I have a requirement where I need to make a callout to an external webservice. However, to make the callout, I need to get a OpenId Auth Token from a corporate webservice first. So, I am trying to use ...
Balaji Pooruli's user avatar
0 votes
1 answer
112 views

Best Approach to Store and Retrieve session information

I am not very old player in Salesforce Integration but I have basic knowledge of Salesforce Integration. For my learning I have created some methods which gets session information from other ...
Saurabh Kher's user avatar
1 vote
0 answers
152 views

LWC - Component not refreshing after NavigationMixin save [duplicate]

I have a button that points to a NavigationMixin that opens a popup for creating a new child record for the parent record they are currently looking at: navigateToNew() { this[...
number41's user avatar
  • 980
0 votes
0 answers
159 views

Alternative for using multiple callouts from Salesforce to external System

We retrieve a list of flight passengers from an external system via a callout. The endpoint sends us a passenger list along with arrival and departure airport codes. Our external system has another ...
Chetan's user avatar
  • 313
2 votes
1 answer
658 views

Platform Cache and default partition

I am implementing the platform cache for first time. My query in below snippent is taking lot of time so I want to put the query result in cache/ if(Cache.Org.contains('cvList')){ for (...
C0DEPirate's user avatar
  • 1,616
0 votes
0 answers
2k views

Incorrect Lightning record page shown for users

We have a profile called as "Consumer Banker", and Consumer Banker profile has the "Consumer Individual Record Page" assigned for the App + Record Type + Profile combination. The ...
Raj's user avatar
  • 3
2 votes
1 answer
257 views

Is there a limit to how many concurrent or total retrievals you can make with Platform Cache?

The features documentation mentions that the Platform Cache API is what allows you to store and retrieve data that's tied to a Salesforce session or shared across your org. Seeing "API" ...
Kris Goncalves's user avatar
1 vote
1 answer
396 views

Use Platform Cache to cache ~50 records from a custom object

We have a custom object that realistically should have been Custom Metadata / Custom Settings as it stores background metadata that controls how pages within our Community load. It has been very ...
McD's user avatar
  • 1,266
4 votes
0 answers
434 views

Org Cache Behaving differently in Sandbox

I'm using org cache to store the results of a call to the google maps geocode api. Just noticed, the caching doesn't seem to work in a Sandbox. You can see how I'm storing/accessing here: public ...
stackasaur's user avatar
8 votes
2 answers
1k views

How can I detect that a packaged Platform Cache Partition has no capacity allocated?

I have a platform cache partition that is packaged as part of a managed package. Once it is installed in a subscribers org it defaults to zero capacity. Using getPartition() and OrgCacheException I ...
Daniel Ballinger's user avatar
4 votes
0 answers
1k views

Detecting change on Record in Lightning Web Component withing Communities

I am looking for a solution to a basic scenario: A User in a Community submits an Opportunity, this Opportunity is enriched with data synchronously upon insert and asynchronously through ...
erikduvet's user avatar
  • 265
3 votes
1 answer
2k views

What is the "default time to live" (TTL) for Platform Cache?

The Platform Cache Partition Class allows a time to live to be specified when a value is put into the cache: put(key, value, ttlSecs) Stores the specified key/value pair as a cached entry in the ...
Keith C's user avatar
  • 136k
1 vote
0 answers
49 views

Writing master-detail records to platform cache

Platform Cache is very good feature for my development work. Today I came across a scenario which it doesn't work the way I intended. Perhaps someone can clarify that for me. I have retrieved a ...
Shiran's user avatar
  • 121
3 votes
1 answer
804 views

How to get time left on OrgPartition from Platform Cache?

Is it possible to get the time left from Platform Cache for a particular partition? You initiate by: Cache.OrgPartition orgPart = Cache.Org.getPartition('local.myStore'); You put the value by (...
S.B.'s user avatar
  • 2,111
17 votes
1 answer
604 views

Does data referenced from the Platform Cache consume heap space?

Reading Platform Cache Limits, it appears that an individual request can obtain up to 1 MB of data from the Platform Cache: Maximum local cache size for a partition, per-request 1,000 KB ... ...
Keith C's user avatar
  • 136k
1 vote
0 answers
203 views

Is it possible to cache into local org partition from a managed package?

Is it possible to cache into local org partition from a managed package? In other words can we do this Cache.Org.put('local.ABCPartition.XYZ', 'Test Object'); from the managed package, where in ...
Sandeep's user avatar
  • 21
0 votes
1 answer
343 views

Does "Request Trial Capacity" for Platform Cache work in scratch orgs?

I clicked the "Request Trial Capacity" button 20 minutes ago in a scratch org and Get Started with Platform Cache says: Click Request Trial Capacity and wait for the email notifying you that your ...
Keith C's user avatar
  • 136k
6 votes
1 answer
453 views

Clean way for code to work with or without Platform Cache?

Just started trying out Platform Cache, and the code needs to work with or without cache partitions set up. As the first error I got was: SessionCacheException:[]: A default partition was not ...
Keith C's user avatar
  • 136k
4 votes
2 answers
576 views

Platform Cache for ISVs

I have used Platform Cache as a customer a while ago but never heard any story about ISVs using it. So, I'm wondering: is there any ISV out there using it and if there is any, how?
Jeferson Chaves's user avatar
4 votes
1 answer
765 views

Salesforce Platform Cache not working in Sales Console

I am using the Platform Cache to store the Id of the customer the salesperson is speaking with on the phone, such that different Lightning Components automatically load the customer's details as the ...
Robs's user avatar
  • 9,396
5 votes
2 answers
978 views

Maintain state in Visualforce Page without using View State

I would know if there is some way to maintain state across different transactions without using View State. For example, if in my Custom Controller, for every action method, I need 100 Account's ...
vt89's user avatar
  • 725
5 votes
1 answer
781 views

Does the Platform Session Cache interpret multiple Site Guest User sessions separately?

I'm considering using a Platform Session Cache for User sessions on my force.com site. My question is: Does the Platform Session Cache interpret the "Force.com Site Guest User" as a single session, ...
Charlie123's user avatar
6 votes
1 answer
251 views

How to debug Lightning components with Platform Cache?

I am researching how to make use of platform cache in a lightning component to reduce the number of API calls that it will need to make. The problem is that when I push code for a Lightning component, ...
AlexKven's user avatar
  • 149
6 votes
1 answer
1k views

How to specify namespace and partition for Org Cache when creating managed package?

I'd like to make an ISV App / Managed package that uses the Platform Org Cache. The clearest directions on how to do this are described in this trailhead. However, when writing my code, I am unclear ...
rynop's user avatar
  • 259
4 votes
1 answer
6k views

SessionCacheException: A default partition was not found. To cache without partition reference, designate a partition as default

I have a simple class for storing values in the cache, similar to this: public class PersonSessionCache { private static final String PERSON_KEY = 'Person'; public static Id getPersonId(){ ...
Robs's user avatar
  • 9,396
3 votes
2 answers
962 views

Cache.Session.contains() always returns False on next script execution even after adding Key with .put()

I am attempting to store values in Cache via an Apex script. I use the Cache.Session.put() method and if I subsequently call .contains() on the next line of the code then the Key shows properly as ...
Tony Rush's user avatar
  • 290
1 vote
1 answer
1k views

How to assign Cache time to Live in CacheBuilder interface?

I was experimenting with Platform Cache and stumbled upon CacheBuilder interface which looks robust for our use cache. The only problem is how can I set time to live in this interface? By default it ...
Pranay Jaiswal's user avatar
1 vote
1 answer
380 views

Platform Cache.Session working only with debug mode

Case Scenario: I need to throw a warning to the user before changing the dates of the standard opportunity. Hence I used Cache.Session to store a variable that checks if the warning has been issued or ...
Dev Arya's user avatar
  • 555
0 votes
1 answer
437 views

Cache value not being saved in Org from Async call

I have a batch call that calls a queuaeble that calls a future call which utilizes a visualforce page 'getContentAsPdf' function. Also in this queuable call I set a custom class value to a local ...
jschleicher's user avatar
1 vote
2 answers
320 views

compiler Error : Invalid type: Cache.OrgPartition

I am trying to use Platform cache via Apex Code. 1. Created a new platform cache partition in my org - 10MB assigned to Org Cache. Then created a simple apex class via dev console to access the ...
Sheetal Pathak's user avatar
3 votes
1 answer
234 views

How does the Platform Cache reconcile the local cache being smaller than the partition size?

I'm reading through Platform Cache Internals and Platform Cache Limits with respect to the local cache and the overall partition size. It appears that the local cache (the application server's in-...
Daniel Ballinger's user avatar
7 votes
1 answer
3k views

Testing Platform Cache usage

When writing Apex test cases for code that utilizes the platform cache what are the important scenarios I need to cover? Additionally, how would I address those is the test methods? For instance, ...
Daniel Ballinger's user avatar
3 votes
0 answers
311 views

Example how Lightning components share data via custom Platform Cache

The title already contains basically everything. Using Google I didn't find a single code example on how to use a custom Platform Cache to save and retrieve data from Lightning components. This is ...
Robert Sösemann's user avatar
3 votes
1 answer
582 views

Deploying PlatformCachePartition Metadata - Tests Fail

I noticed a strange behaviour when deploying PlatformCachePartition metadata which also includes test methods in the same package. Below is an example of the PlatformCachePartition metadata: <?xml ...
Boris Bachovski's user avatar
4 votes
0 answers
178 views

How to tell if Platform Cache is available in package?

If I include a Cache Partition in my managed package but don't activate it in the subscriber org (i.e. subscriber has not purchased a license), how do I check if I should be hitting the cache or not? ...
Mossi's user avatar
  • 3,986
3 votes
1 answer
658 views

Platform Cache System Error (Random)

A few of the users in the system have hit an interesting error after implementing some functionality around the platform cache. I received the emails as the owner of the files, but I was not able to ...
Boris Bachovski's user avatar