Chapter 9: Security and Performance
290
In this case, the file cryptically (no pun intended!) called 30c0de8e2eda3538b8963d9bd6251e14 is the home
page that was being cached. You can confirm it by running the file through cat or another shell editor to see :
1207440748TS--- > < !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd” >
< html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en” >
< head >
< meta http-equiv=”content-type” content=”text/html; charset=utf-8” / >
< title > Welcome to Claudia’s Kids < /title >
< link href=”http://shopping.tripledogs.com/css/default.css” rel=”stylesheet”
type=”text/css” / >
< script type=”text/javascript” >
// < ![CDATA[
base_url = ‘http://shopping.tripledogs.com/’;
//]] >
< /script >
< script type=”text/javascript”
src=”http://shopping.tripledogs.com/js/prototype.js” > < /script >
< script type=”text/javascript”
src=”http://shopping.tripledogs.com/js/scriptaculous.js” > < /script >
< script type=”text/javascript”
src=”http://shopping.tripledogs.com/js/customtools.js” > < /script >
< /head >
< body >
< div id=”wrapper” >
< div id=”header” >
< a href=”http://shopping.tripledogs.com/” >
< img src=”http://shopping.tripledogs.com/images/logo.jpg” border=”0”/ >
< /a >
< div id=’globalnav’ >
< ul >
< li > < a href=http://shopping.tripledogs.com/welcome/index
...
The first bit, the 1207440748TS--- > , is when this particular cached page expires, in UNIX time - stamp
format.
Turning Off Profiling
It is time to turn off profiling, as you don ’ t need it anymore. Simply erase the line from your controller,
or set the profiler to FALSE.
function Welcome(){
parent::Controller();
$this- > output- > enable_profiler(FALSE);
}
Benchmarking
The Benchmark class can be used to mark start and end points in your code and to print out how much
time (or how many resources) was used by that code. Benchmarking can be used in controllers, views,
and models and are a great way to dig deeply into a performance - based problem.