APGen Documentation Previous Topic: Mixing Script Languages Next Topic: Static Page Generation Parent Topic: Active Page Generator Documentation    Active Page Generator Documentation
Web Site Optimization Techniques
See Also:

Typical Results

One of APGen's primary uses is improving the performance of dynamic web sites.  The performance gains from using APGen vary widely: In some cases, no gain can be achieved; in other cases gains of 100 times can be obtained.  Figures 1 and 2 show typical results from APGen optimization:

Figure 1: Improved Web Site Capacity

Figure 2: Faster Web Page Response Under Load

We have found that APGen is consistently the easiest and most cost-effective way to obtain performance improvements of this magnitude.  Like all tools, APGen should only be used when and where it makes sense.  These topics will help you to determine when and how to use APGen to improve the performance of your web site.

Sites That Can Be Optimized

Many dynamic sites perform the same content generation work during repeated HTTP Requests.  If the same content is being generated many times, then the web server is doing too much work.  The site will not scale well and individual page rendering will be slow.  Most web systems only perform content generation while fulfilling HTTP Requests.  APGen provides another option: APGen performs content generation independent of HTTP Requests.  If some or all of the content generation work can be offloaded to APGen before the page is requested, then less work is performed per HTTP Request, and the web site will perform more efficiently.

APGen optimization should be applied to any dynamic web site that performs a significant amount of work per page, that expects moderate or greater user load, and/or that displays some data that changes less often than it is viewed.  If it makes sense to use APGen in your web site, then you will see performance gains that can only be matched by spending tens of thousands to millions of dollars in hardware and network upgrades.

In this article, the focus is on improving ASP performance.  APGen can also be used to improve the performance of other dynamic web server products, including Java Server Pages and ColdFusion (CFML) pages.  In addition, web sites hosted on other platforms (like Unix and Linux) can be optimized with APGen.  When using APGen with other web servers and other platforms, the principals are the same, but the generated file formats may differ.

To illustrate, here are a few web applications that are easily optimizated with APGen:

And now, a few dynamic web applications that are bad targets for APGen optimization:

Real-world web sites typically contain some pages that can reap significant benefits from APGen optimization, and other pages that cannot be optimized, or can be partly optimized.  Depending on the page, one or more APGen optimization techniques may be appropriate:

Optimization Techniques

Active Page Generator and ASPCache enable a range of techniques for optimizing any given dynamic page.  The techniques include static page generation, two-phase content generation, and page fragment caching.  Each technique has its strengths and weaknesses.  Techniques can be mixed within a site and within a single page, as appropriate.  The choice of which technique to use largely depends on how volatile the underlying data is, and how much the page needs to change for each user.

This table briefly describes when to use which technique.  For more, see the topic covering each technique:

Technique Best For
Static Page Generation Pages with no user-dependent or interactive content
Two-Phase Content Generation Pages with some user-dependent and some non-user dependent content.  If a page has a number of output combinations (ex: a product page), use Page Fragment Caching also.
Page Fragment Caching Pages with some user-dependent and some non-user dependent content.  If the non-user dependent content has numerous output combinations it should be optimized using  Page Fragment Caching.
100% Dynamic Pages Pages where all content or behavior is user-dependent.