There are a couple of ways you can do this. I think my favorite way would be to use a Front Cache like Squid or Varnish to catch page requests before they get to the webserver. This works very well when you have static content or content that isn't changed very often. One can use small increment caching keeping the page cached for as little as 1 minute or less.
Caching a page for 1 minute would mean the system would only have to process the ColdFusion/Database and other commands to generate the page only 60 times per hour. Even if a link went viral, the server would only make 60 pages per hour. This is the general architecture used by Wikipedia among others. Partial Page Caching is very easy and built-in to MG: http://docs.model-glue.com/wiki/HowTos/HowToUseContentCaching#ContentCaching Full page caching is totally doable. You can leave the core MG alone and do full page caching by listening for the opening event, modelglue.onRequestStart and the closing event: modelglue.onRequestEnd. By the time modelglue.onRequestEnd runs, all the views will be rendered and you'll be able to grab the content out of the view collection. Do your check in onRequestStart to decide what to render.... Docs on built in Event Handlers: http://docs.model-glue.com/wiki/ReferenceMaterial/ModelGlueBuiltInEventHandlers DW On Mon, Sep 24, 2012 at 9:34 AM, olivierb <[email protected]> wrote: > Hi, > > I know that Model-Glue uses caching for the model, controller, and helper > files. We're also using caching in our queries to the database. However, I'm > trying to tweek performance as much as possible. > 1) I wonder if there's still a benefit to caching using CFCache to cache > entire code snippets or even full pages. I suspect there probably is but I'm > just wondering what others think. > 2) If I want to do full page caching, where would I need to put the cfcache > tag? Probably in the template file that includes all the views? > > -- > Olivier Bridgeman > > -- > Model-Glue Sites: > Home Page: http://www.model-glue.com > Documentation: http://docs.model-glue.com > Bug Tracker: http://bugs.model-glue.com > Blog: http://www.model-glue.com/blog > > You received this message because you are subscribed to the Google > Groups "model-glue" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/model-glue?hl=en -- Plutarch - "The mind is not a vessel to be filled but a fire to be kindled." -- Model-Glue Sites: Home Page: http://www.model-glue.com Documentation: http://docs.model-glue.com Bug Tracker: http://bugs.model-glue.com Blog: http://www.model-glue.com/blog You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en
