Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 261

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Optimizing ColdFusion applications
You can optimize your ColdFusion application in many ways. Optimizing ColdFusion mostly involves good
development and coding practices. For example, good database design and usage is a prime contributor to efficient
ColdFusion applications.
In many other topics, the optimization techniques provided are pertinent to the related ColdFusion topic. The
following information is about general ColdFusion optimization tools and strategies, and particularly about using
CFML caching tags for optimization. There is also information on optimizing database use, an important area for
application optimization.
The ColdFusion Administrator provides caching options for ColdFusion pages and SQL queries. For information on
these options, see the ColdFusion Administrator online Help and Configuring and Administering ColdFusion.
For information on debugging techniques that help you identify slow pages, see
Applications" on page 378.
For additional information on optimizing ColdFusion, see the Adobe ColdFusion support center at
www.adobe.com/go/learn_cfu_support_en.
Caching ColdFusion pages that change infrequently
Some ColdFusion pages produce output that changes infrequently. For example, if you have an application that
extracts a vendor list from a database or produces a quarterly results summary. Normally, when ColdFusion gets a
request for a page in the application, it does all the business logic and display processing that are required to produce
the report or generate and display the list. If the results change infrequently, it is an inefficient use of processor
resources and bandwidth.
The
tag tells ColdFusion to cache the HTML that results from processing a page request in a temporary file
cfcache
on the server. This HTML need not be generated each time the page is requested. When ColdFusion gets a request for
a cached ColdFusion page, it retrieves the pregenerated HTML page without having to process the ColdFusion page.
ColdFusion can also cache the page on the client. If the client browser has its own cached copy of the page from a
previous viewing, ColdFusion instructs the browser to use the client's page rather than resending the page.
Note: The
tag caching mechanism considers that each URL is a separate page. Therefore,
cfcache
http://www.mySite.com/view.cfm?id=1 and http://www.mySite.com/view.cfm?id=2 result in two separate cached pages.
Because ColdFusion caches a separate page for each unique set of URL parameters, the caching mechanism
accommodates pages for which different parameters result in different output.
Using the cfcache tag
You tell ColdFusion to cache the page results by placing a
outputs text. The tag lets you specify the following information:
• Whether to cache the page results on the server, the client system, or both. The default is both. The default is
optimal for pages that are identical for all users. If the pages contain client-specific information, or are secured with
ColdFusion user security, set the
• The directory on the server in which to store the cached pages. The default directory is cf_root/cache. It is a good
practice to create a separate cache directory for each application. Doing so prevents the
from inappropriately flushing more than one application's caches at a time.
• The time span that indicates how long the page lasts in the cache from when it is stored until it is automatically
flushed.
You can also specify several attributes for accessing a cached page on the web server, including a user name and
password (if required by the web server), the port, and the protocol (HTTP or HTTPS) to use to access the page.
cfcache
attribute in the
action
cfcache
Last updated 1/20/2012
"Debugging and Troubleshooting
tag on your ColdFusion page before code that
tag to
.
ClientCache
cfcache
256
tag
action
flush

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents