Improving Performance - Caching conditions
(Page 6 of 6 )
Some sites use various parameters to recognize which version of the same page to serve. For example, the 'Request' parameter can be set so that it serves the appropriate page for Internet Explorer and Netscape browsers.
Full Page caching with conditions allows you to save distinct output based on the requesting URL query string or parameters such as: Get, Cookie, Request, Server and Session. Caching conditions can also be used to determine whether or not to serve identical requests from the cache. For example, Zend.com has some pages that should be only cached when the end-user is not logged in. When the end-user is logged in, Zend.com sets a cookie named Zend_In, signifying that the user has logged in. A caching condition can be set to cache the relevant pages only when the user is not logged in, in other words, 'Zend_In' is not set: -COOKIE:Zend_In.
It is important to note that some pages cannot be cached at all. Server-side script pages that process information submitted via an HTML form must be executed for every request and should never reside in a Web content cache. It may be useful to cache the form itself, especially if fields are populated from a database table.
Partial page caching
Partial caching provides greater flexibility and control for pages that contain both static and dynamic content. By selecting portions of the page to cache, only relevant parts of the page are cached while the dynamic content remains untouched.
Imagine the above store page containing current campaigns, general navigation, store navigation, Featured categories and My account including the shopping cart information. The entire page is static information collected from four database queries, except the My account section, which calls another database query. By caching the static queries and dynamically processing only the My account query, it is possible to save 80 percent of the original work for displaying the page.
Compression
Some server-side dynamic content caching solutions also implement page compression. This functionality removes all the remarks and white space inside the HTML that is sent to the clients. Additionally, the file can be zipped, reducing its size by as much as 80%. Compressed pages download much faster and further enhance the user's experience.
Conclusion
Performance improvement is the first step in the cycle of growth. Even by itself it is a broad statement encompassing many concerns for network elements, each one calling for a different solution. As your site growth and you go through the growth cycle you will add to and modify your infrastructure. At each point, choose among the various caching solutions depending on the type of data your site servers and the location of the bottleneck.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |