Created
February 18, 2024 22:09
-
-
Save trycf/225c9ceb47c6f7950e64e630cbadbb36 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
cache_time = createTimeSpan(1,0,0,0); | |
function foo(args) cachedwithin=cache_time{ | |
return args; | |
} | |
writeDump( foo('test') ); | |
/* | |
queryExecute( | |
sql: " | |
SELECT * | |
FROM table | |
WHERE param1 = :param1 | |
AND param2 = :param2 | |
", | |
params: { | |
param1 = {value = "antani", cfsqltype = "varchar"}, | |
param2 = {value = 2, cfsqltype = "integer"} | |
}, | |
options: { cachedwithin: cache_time } // <----- this works! | |
); | |
/* | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment