ColdFusion Page Caching

Hello.  Would setting up page caching in the onRequestStart method of your Application.cfc file be useless or even dangerous in any way?  Most of the pages on our site are dynamic (random ads pulled on the front page and search results page based on users' entered criteria).

Also, on pages with static content, is it even worth doing client-side caching with the <cfcache> tag if your browser already does it?  If the user has caching turned off in their browser, would it still cache?
Who is Participating?
If you are loading page data from a DB, but that data does not change often, caching can improve performance, because a new call to the db does not have to be made, it just shows the cached copy. If you are loading data that is changing all of the time (perhaps a news site) then you will improve performance, but may miss the new data, as that cached page will be displayed instead of going and getting the current data.
If you cache the page you risk not getting new data. If new ads will show up each time, you will not get them all. If the data on the screen can change with each request, I would not recommend caching. This is only for pages where the data does not change often.

I do not think there will be a difference using cfcache on a static page. It will generally improve server performance on dynamic pages.
varimerewebAuthor Commented:
Thanks silvera, but I'm a bit confused.  The first paragraph, you stated that it is not a good idea to cache pages with dynamic/changing content due to the risk of new data not being shown to the user, but the second paragraph, you stated it improves server performance to cache dynamic pages.  Please clarify.  Thanks!
You should also know:

* You can cache sections of a page as opposed to caching the whole page.
   So you can have ads running on the top and side sections while caching the content that is static.

*  Also there is an option to cache on client(browser) or web server in the cfcache attributes.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.