3 ``Deferred'' component rendering

The <:component:> and <:datacomp:> also accept as an argument value to the cache argument the value "defer". If this has been specified, then SkunkWeb will handle the caching of the component in a graceful, and often more efficient, way.

When deferral is activated, SkunkWeb will look in the cache to see if there is output cached for the component under the set of arguments you passed. If it finds cached output, SkunkWeb uses it and does not execute the component, just as if it weren't specified. If SkunkWeb does not find any cached output, it executes the component and caches the result, just as if deferral was not requested. However, if SkunkWeb finds cached output, but it is expired, SkunkWeb will use the cached output anyway, and ``defer'' the execution of the component until after all of the output has been sent back to the client in the response. Then, after sending all of the output back to the user, SkunkWeb executes the component and caches its output.

This gives you a great performance gain: if any component's cached output expires, no individual user will have to wait for the component to be executed before receiving her response. The component's cache will be updated offline, behind the scenes.

You can make all of your component calls automatically ``deferred'' by setting the configuration variable DeferByDefault to 1.