O'Reilly logo

Railo 3 Beginner’s Guide by Mark Drew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - comparing template caching settings

Let's have a look at what impact these settings have on a normal request.

This way we can compare how long it takes for the request for each of the different settings. Let's create some templates to test:

  1. In the <Railo Install Directory>/webroot/, create a template called speed_test.cfm with the following code:
    <cfscript>
    totalPage = 0;
    loop from=1 to=10 index="i" {
    FileWrite("my_include.cfm", "<cfset myvar_#i# = Now()>");
    includeStart = getTickCount();
    include template="my_include.cfm";
    includeTotal = getTickCount() - includeStart;
    totalPage += includeTotal;
    WriteOutput("Include #i# took: #includeTotal# <br>");
    sleep(1000);
    }
    WriteOutput("Total include time #totalPage#");
    </cfscript>
    
  2. This code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required