is it possible cache multiple variables in a single populate cache ?

is it possible cache multiple variables in a single populate cache ? Any help is appreciated. Thanks !!

0 4 714
4 REPLIES 4

@venu , Yes, Absolutely, It's possible.

What have you tried ? Can you post your implementation & update the question ?

@Anil Sagar @ Google Thanks for the response. I am writing a java script which sets multiple variables and I have to cache these variables. Can you please refer to an example with same implementation?. Thanks in advance !!

If you have a Javascript, why not just store a context variable that contains a json with all of the things you want to cache?

var thingsToCache = {
  var1 : var1,
  var2 : true, 
  var3 : 1982393 
};
context.setVariable('thingsToCache', JSON.stringify(thingstoCache));

Unfortunately no. Populate Cache policy accepts a single argument as Source (i.e. a single variable).

What I generally do is to create a quick/compact json object, assign that to a variable and then set the Source to that variable.