Adobe COLDFUSION 9 Manual page 263

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
<!--- Greet the us er. --->
<cf output>
W elcome to our home page.<br>
The time is #TimeFormat(Now())#.<br>
Your lucky number is: #RandRa nge(1,1000)#<br>
<hr>
</cfoutput>
<!--- If the flag is false, query the DB, and save an image of
the results output to a variable. ---> <cfcache action="optimal"
timespan="#createtimespan(0,1,0,0)#" idletime="#createtimespan(0,0,30,0)#"><!--- Perform
database query. ---><cfquery dataSource="cfartgallery" name="specialQuery">
art
</cfquery>
<!--- Calculate sale price and display the results. --->
<h2>Check out the following specials</h2>
<table>
<cfoutput query="specialQuery">
<tr>
<td>#artid#</td>
<td>#Description#</td>
<td>#price#</td>
</tr>
</cfoutput>
</table></cfcache><hr><p>Thank you for visiting us!</p>
In this example, the highlighted code creates a page fragment that displays all art records from the table
is set to expire either after one hour or after an idle time of 30 minutes. After the cache is invalidated, cache is recreated
the next time the page is accessed thereby displaying updated information (if any).
Using Amazon S3 storage
Note: To use this feature, you must install ColdFusion 9 Update 1
.ColdFusion customers can now store data in Amazon S3. The support is extended across almost all tags and functions
that take file or directory as input or output.
Storing files in Amazon S3 can be performed in the same manner as storing files on disk. Use a prefix
that the files reside on Amazon S3. For example,
Amazon S3
For using Amazon S3, ColdFusion user must have an S3 account with Amazon.
For concepts and details related to Amazon S3, see the
Accessing Amazon S3
Use either of the following URL formats to access Amazon S3 from ColdFusion:
s3://bucket/x/y/sample.txt
Here,
is the name of the bucket and the remaining portion of the URL is the key name of the Amazon S3
bucket
object.
In this case, specify the following authentication information in the Application.cfc:
s3://testbucket/sample.txt
AmazonS3
Documentation.
Last updated 8/5/2010
SELECT * from
. The cache
art
to indicate
s3://
.
258

Advertisement

Table of Contents
loading

Table of Contents