Optimizing ColdFusion applications
277
Optimizing ColdFusion applications
You can optimize your ColdFusion application in many ways. Much of optimizing ColdFusion
involves good development and coding practices. For example, good database design and usage is
a prime contributor to efficient ColdFusion applications.
In several places, this book documents optimization techniques as part of the discussion of the
related ColdFusion topic. This section provides information about general ColdFusion
optimization tools and strategies, and particularly about using CFML caching tags for
optimization. This section also contains information on optimizing database use, an important
area for application optimization.
The ColdFusion MX Administrator provides caching options for ColdFusion pages and SQL
queries. For information on these options, see the ColdFusion MX Administrator online Help
and
Configuring and Administering ColdFusion MX
.
For information on debugging techniques that can help you identify slow pages, see
Chapter 18,
“Debugging and Troubleshooting Applications,” on page 389
.
For additional information on optimizing ColdFusion, see the Macromedia ColdFusion support
center at www.macromedia.com/support/coldfusion.
Caching ColdFusion pages that change infrequently
Some ColdFusion pages produce output that changes infrequently. For example, you might 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 required to produce the report or generate and display the list. If the
results change infrequently, this can be an inefficient use of processor resources and bandwidth.
The
cfcache
tag tells ColdFusion to cache the HTML that results from processing a page request
in a temporary file on the server. This HTML does not need to 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
cfcache
tag caching mechanism considers each URL to be a separate page. Therefore,
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 putting a
cfcache
tag on your ColdFusion page
above code that 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
action
attribute in
the
cfcache
tag to
ClientCache
.
Содержание COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...