Created
June 3, 2015 09:48
-
-
Save aliaspooryorik/c78e2fee26080fd4db0b to your computer and use it in GitHub Desktop.
testing Lucee's function caching
This file contains hidden or 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> | |
function foo(a=1,b=2) cachedwithin="#createTimeSpan(0, 0, 0, 10)#" { | |
writeoutput(getTickCount() & " " & hash(serializeJSON(arguments)) & "<br>"); | |
sleep(10); | |
} | |
foo(1, 2); | |
foo(a=1, b=2); | |
foo(b=2, a=1); | |
foo(b=2); | |
foo(a=1); | |
foo(); | |
// see if it's cached with same args | |
foo(1, 2); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment