来自以上评论:
CF2016 没有做命名参数。那是从 CF2018 开始的。因此,您必须取出名称并在第 3 和第 4 位置传递一些东西。通常你可以只传递正常的默认值。我不确定 CF2016 中的这个标签是什么,但 F2018 文档http://cfdownload.adobe.com/pub/adobe/coldfusion/2018/publicBeta/NamedParametersColdFusion2018.pdf似乎表明默认值都是空字符串.
尝试
CachePut(_attr.path,attr.qryPath,"","",variables.cacheRegion) ;
例子:
https://cffiddle.org/app/file?filepath=a253f587-43fa-482f-b4cd-c7bbb8b45f3d/252b1e4b-d303-4a16-9d80-7c657e6e7770/7c0dc772-099c-4827-8e2f-068b2e32a4d8.cfm
<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>