I want to use CachePut()
. In particular, I want to
CachePut(id = _attr.path, value = attr.qryPath, region = variables.cacheRegion);
id
, value
, and region
are the 1st, 2nd, and 5th parameters respectively.
Adobe says the 3rd through last parameters are optional. Source: https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/CachePut.html
How do I pass in the 1st, 2nd, and 5th? When I try it, I get:
FROM ABOVE COMMENTS:
CF2016 didn't do named parameters. That started with CF2018. So you'd have to take out the names and pass something in the 3rd and 4th position. Normally you can just pass the normal default values. I'm not sure what those are for this tag in CF2016, but the F2018 doc http://cfdownload.adobe.com/pub/adobe/coldfusion/2018/publicBeta/NamedParametersColdFusion2018.pdf seems to indicate the defaults are both empty strings.
Try
CachePut(_attr.path,attr.qryPath,"","",variables.cacheRegion) ;
EXAMPLE:
<cfscript>
attr.Path = "_path" ;
attr.qryPath = "querypath" ;
variables.cacheRegion = "newCacheRegion" ;
CacheRegionNew(variables.cacheRegion);
//WriteDump(CacheGetProperties(variables.cacheRegion));
CachePut(attr.Path,attr.qryPath,"","",variables.cacheRegion);
writeDump(CacheGet(attr.Path,variables.cacheRegion));
</cfscript>