/cacheManagement/examples/root/basic/index.cfm
http://coldfusioncachemanager.googlecode.com/ · ColdFusion · 85 lines · 47 code · 38 blank · 0 comment · 4 complexity · 983330d1088b48a3fcb3b9f7a3038228 MD5 · raw file
- <cfimport taglib="/cacheManagement/util/" prefix="cache" />
- <html>
- <head>
-
- <link type="text/css" href="/cacheManagement/examples/assets/style.css" rel="stylesheet" />
- <title>Cache Management Examples</title>
-
- </head>
-
- <body>
-
- <cfscript>
- cm = getCacheManager();
-
- startTime = getTickCount();
-
- if( not cm.exists( 'Computer', 'myComposite' ) ){
-
- message = "set a cache";
-
- c = getFactory().createComputer();
-
- cm.add( 'Computer', 'myComposite', c );
-
- }else{
-
- for( f=1; f<=5; f++ ){
-
- for( i=1; i<=1; i++ ){
-
- c = cm.get( 'Computer', 'myComposite' );
-
- }
-
- sleep( 10 );
-
- }
-
- message = "get a cache";
-
- }
-
- endTime = getTickCount();
-
- totalExecution = endTime - startTime;
- </cfscript>
-
- <div class="title">Basic examples</div>
-
- <p></p>
-
- <textarea cols="60" rows="5" class="code">
- cm = getCacheManager();
-
- startTime = getTickCount();
-
- if( not cm.exists( 'Computer', 'myComposite' ) ){
-
- c = getFactory().createComputer();
-
- cm.add( 'Computer', 'myComposite', c );
-
- }else{
-
- c = cm.get( 'Computer', 'myComposite' );
-
- }
-
- endTime = getTickCount();
-
- totalExecution = endTime - startTime;
- </textarea><br/>
-
- <br/>
- <p>Command: <cfoutput>#message#</cfoutput>.</p>
- <p>Total execution time: <cfoutput>#totalExecution#</cfoutput> ms</p>
-
- <a href="../../index.cfm">Back to home</a><br />
-
- <cache:monitor cacheManager="#cm#" />
- </body>
- </html>