21
Caching for Performance Jeff Tapper Tapper.net Consulting

Caching for Performance

  • Upload
    didina

  • View
    50

  • Download
    0

Embed Size (px)

DESCRIPTION

Caching for Performance. Jeff Tapper Tapper.net Consulting. Agenda. What is Caching Why is Caching important Where can I implement caching What to Cache within CFMX How to Cache within CFMX Summary. What is Caching. A Cache is a place where something is temporarily stored - PowerPoint PPT Presentation

Citation preview

Page 1: Caching for Performance

Caching for Performance

Jeff Tapper

Tapper.net Consulting

Page 2: Caching for Performance

Agenda

What is Caching Why is Caching important Where can I implement caching What to Cache within CFMX How to Cache within CFMX Summary

Page 3: Caching for Performance

What is Caching

A Cache is a place where something is temporarily stored

By storing frequently used items, the need to recreate them is mitigated

Page 4: Caching for Performance

Why is Caching Important

Each operation a server performs takes time / resources

By reducing the number of operations any server performs, we increase the ability for that server to handle more requests

Faster Page Loads Increased Scalability

Page 5: Caching for Performance

Places to Cache

Database ColdFusion Web Server Network

Page 6: Caching for Performance

Places to Cache

Network Diagram

Page 7: Caching for Performance

What to Cache in CFMX

Data CFC instances Webservices Pages Content

Page 8: Caching for Performance

What to Cache in CFMX

Data Caching common queries can

greatly increase speed pages are built

Reduces network traffic between CFMX and Database

Page 9: Caching for Performance

What to Cache in CFMX

CFCs CFCs are the new core building

block of CFMX applications Instantiation of CFCs is an

expensive (slow) process

Page 10: Caching for Performance

What to Cache in CFMX

Webservices Calling a webservice invokes a

complex process. Requests WSDL, parses it, makes

calls to methods Caching WSDL reduces over all

processing time 3-5x

Page 11: Caching for Performance

What to Cache in CFMX

Pages Many applications have entire pages

which do not change frequently Caching the entire page can reduce time

needed by CFMX In some cases, pages can be cached as

HTML, removing the need for CFMX to process it at all

Page 12: Caching for Performance

What to Cache in CFMX

Content Often, even in pages which are not

static, many sections of the page are.

Caching the static parts of the page reduces the time CFMX needs to build the page.

Page 13: Caching for Performance

Data Caching in CFMX

Cached Within Cached After Storing query in shared scope

variables

Page 14: Caching for Performance

Data Caching in CFMX

Benefits Great for dynamic

queries Easy to implement Built in Timeout

Drawbacks Purging non-trivial

Using CFQUERY attributes to CacheUsing CFQUERY attributes to Cache

Page 15: Caching for Performance

Data Caching in CFMX

Benefits Easy to Manage Not limited by “Max

Number cached queries”

Drawbacks Not well suited for

dynamic queries More Complex

implementation Lacks built-in timeout

Query Caching in a shared scopeQuery Caching in a shared scope

Page 16: Caching for Performance

CFC Caching in CFMX

Storing instances in shared scope variables

Page Context Bug

Page 17: Caching for Performance

Webservice Caching in CFMX

CFMX automatically caches WSDL

Page 18: Caching for Performance

Page Caching in CFMX

Trusted Cache CF_SuperCache Custom Built Solutions

Page 19: Caching for Performance

Caching content in CFMX

CFCACHE CFSAVECONTENT

Page 20: Caching for Performance

Summary

Effective use of caching can greatly extend the scalability of an application

Every application offers a myriad of caching possibilities

Caching opportunities exist both within and outside the CFMX server

Page 21: Caching for Performance

Questions

?